Refactor dbloader to remove duplicated code

Use a try...except block in run_as_daemon to hold the shutdown logic
duplicated between different try...except clauses.

Change log messages to use % formatting rather than string concatanation.
Change self.name to self.current_msg in loader.py

Change self.name to be more descriptive and check in the shutdown
function that it has been assigneed to as it may not have been before a
shutdown is initiated.