Fix mistake in convert_lt_files
[#2161] Save magnet torrent_info to 'copy of' location

When magnet metadata is received a torrent file will also be written
to 'copy of' location if requested.
Modified the code for saving torrent file to state in Torrent class for
use by TorrentManager.
Refactor TorrentState to build the class attributes
[#1032] Keep track of torrent errors over restarts

 * Add error_statusmsg to TorrentState
 * Adds a new set_error_statusmsg() method to force torrent error state.
 * Any torrent in error state will remain in that state on restart with
   additional message in status.
 * Any new libtorrent errors will override manually set ones.
Use flush_disk_cache as a shutdown marker

This is a hacky fix for waiting_on_resume_data not being empty on
shutdown. This issue needs further investigating.