Forces Windows (Vista and above) shutdown to wait qBittorrent to terminate cleanly

This pull request is related to issue #1535 

Starting from Vista, Microsoft has changed the shutdown management.
This patch tries to avoid the brutal kill of qBittorrent process before its clean termination.