If there is a pending timeout, remove it from the IOLoop and set the
    ``_timeout`` global to None.

def _maybe_stop_timeout():
    """If there is a pending timeout, remove it from the IOLoop and set the
    ``_timeout`` global to None.

    """
    global _timeout

    if _timeout is not None:
        LOGGER.debug('Removing the pending timeout (%r)', _timeout)
        ioloop.IOLoop.current().remove_timeout(_timeout)
        _timeout = None