Wait for leaderDiskThread to finish on stepDown()

This fixes a potential bug in which leaderDiskThread, for example, closes
a file descriptor that doesn't belong to it anymore
Add LogFactory to instantiate the proper Log based on the config