Fix silly inverted-logic bug in closing a connection.