Ensure that ThreadedHTTPTransport sends all pending messages at exit

A race condition in the ThreadedHTTPTransport exit hook meant that it was
possible for some queued messages to not be sent.

Rearrange the shutdown hook a bit to ensure that this cannot happen.
Merge branch 'master' into fix_async_sender_shutdown
Merge branch 'master' into fix_async_sender_shutdown
Merge branch 'fix_async_sender_shutdown' of https://github.com/swiftserve/raven-python into swiftserve-fix_async_sender_shutdown
Minor stylistic changes