Catch AttributeError in client connected check

If the client has never connected, there will be no __transport attribute.