Add a global IMAP_DEBUG flag

The idea here is that I don't always want to print out all by debug
info.
Somewhat enforce that IMAP connections are closed

This isn't perfect: you'll still need to remember to call
client::logout() from every direct subclass of mhimap::client, but I
think that shouldn't be too hard -- as far as I know there will only
ever be two of them.