Fix a bug on re-initiating logger after running logrotate.

When log is being refreshed to run logrotate, existing handlers were
not cleared properly.