Setup some global variables earlier.

Without this change, I could get a crash if I deleted a download fast
enough.
bz19900: update metainfo for magnet torrents when we get it
Another torrent title fix

Try to get the torrent title from the magnet URI if we can.  I'm not
sure if it's always possible or correct, but it's better than just
using the filename of the URI.