qbittorrent/qBittorrent — pull request #433 by Gelmir (2013-02-16 13:09:39+00:00)
Title: Attempt to fix data loss during session end

Rationale:

1. According to [docs](http://doc.qt.digia.com/stable/qapplication.html#commitData) we should not exit application in `commitData`, which we do, because `sessionIsShuttingDown` signal is blocking.
1. I'm also making `sessionIsShuttingDown` -> `deleteBTSession` direct, so the [slot is called immideatly](http://doc.qt.digia.com/stable/qt.html#ConnectionType-enum).

`ShutdownBlockReasonCreate` and `ShutdownBlockReasonDestroy` function calls are the last line of 'defense'. These functions only exist on vista and higher, so using dynamic loading through `LoadLibrary` is the only option to maintain compatibility without rebuilding. This way qBt will have all the time it needs to clean up.