From Jim Pryor
The first, "cleanup.patch", cleans up a few spots that tend to throw
exceptions for me as offlineimap is exiting from a KeyboardInterrupt.
module threading should be taken out back and shot.
Condition.wait() is a busywait loop that has negative implications for
battery consumption on laptops.
Queue.get() in blocking mode blocks SIGINT from being delivered.
Argh, argh, argh.
Closes: #493801.