Validates if a connection is open before using it