This may be due to some quirk of my code, but I've found that with this line as written:
self._connection_manager.free_socket(self._sock)
the MQTT connection doesn't close on calling disconnect(). For me it does work if I change that line to:
self._connection_manager.close_socket(self._sock)