Add extra check before accepting a passed in connection.

No use in using a passed in connection that's not connected.