Small fixes to path chooser

* Handle completion when removing characteres while the popup is visible
* Set Apply button sensitive when changing move completed path in options tab
daemon code and comment cleanup, removed double call to _shutdown
GTKUI: Simplify the quit code for mainwindow
Fix daemon log being clobbered by running another instance with same config dir

Also includes small fixes and code cleanup
GTKUI: Fix Show Zero Hits to only apply to state, owner and tracker_host

There is an issue with the Label plugin where a new label would 'disappear'
and you could not change the options for the new label with zero hits hidden.
lower case 'l' for libtorrent in user_agent string
Fix gettext setup in test_common and log in test_transfer so tests run standalone

Add extra tests to test_config
Run the test files through flake8 to tidy up code
Handle plugin info not available
Removed call to save_config in path-chooser (obsolete)
Fixup saving and loading state files

 * All state files have a backup created before saving
 * The backup will now be used if saving or loading fails
 * GTKUI state files stored in new gtkui_state dir and common load/save functions created
 * Detects bad shutdown and archives timestamped state files in separate config directory.
Fix typo in authmanager
Fix mistake in torrentmanager
Fix #2303 : Torrent state not updated until after emitting TorrentFinishedEvent
Cleanup torrentmanger code

 * Remove legacy/old state file code
 * Passes flake8 cleanly
 * Most pylint messages dealt with
 * Code now uses >=Python 2.6 'with' and 'as' statements
Add flake8 to setup.cfg and add missed change to #2303 fix
Fix overzealous legacy code removal from torrentmanager
Fix some typos in my previous commits
Fix 2247: AttributeError in deluge.error.DaemonRunningError

* Removed all the properties in error.py and added more tests
* Handle failure in client.py handling RPC_ERROR (From older daemons)
Speedup in tracker_error_filter
Cache items in get_filter_tree