should terminate @receiver_thread of Net::IMAP safely
@receiver_thread of Net::IMAP may be terminated by exception,
and this causes the process termination if Thread.abort_on_exception is true.
Then Net::IMAP#disconnect does not call @receiver_thread.join if TCPSocket#close
raises an exception.
Reported by Tanaka Akira in [ruby-dev:34821].