Fix reloading of logging settings.

restart_logging() wasn't properly reloading the logging settings. It
didn't know about all the handlers that were set, meaning the previously
registered ones wouldn't be reloaded. This led to duplicate log messages
with every attempt to reload.

It now unregisters every single log handler before re-adding them.

Reviewed at https://reviews.reviewboard.org/r/5934/