For the topology.Connection type, we release the server's semaphore in the Close and Expire methods, but only set the underlying connection to nil if there are no errors. This could lead to a semaphore being released too many times if the following happens:
1. Close is called. Semaphore is released once but there is an error putting the connection back in the pool, so the underlying connection is not set to nil.
2. Close is called again. The semaphore is released again, causing a panic.
To fix this, we should move the line that sets connection to nil higher up so that it always happens and avoids a panic.