Fixed shutdown thread so the logger wont open a new file and write all
shutdown logs there.