Add purging of message queues to loader.

- Add purge of message queues after loading all messages to avoid empty
  intermediate directories filling up top directory. Only purges if
  messages found to reduce overhead.
Tidy and improve dbloader log message output.

- Add traceback for unexpected exceptions using logging.exception().
- Remove pointless type(exception) as this would always return 'instance'.
Unlock current message queue element on shutdown.

- Add unlocking of current msg queue element to shutdown method so no
  locked elements left if shutdown called during long loading operation.
- To support first change, make current element reference an instance
  object so it can be queried by shutdown method.
- Correct string formatting conversion in log message.