Fix issue #219: I/O operation on closed file exception with --log

`log_fp` was closed and then used, and `log_fp` name was reused and that makes some confusion.

I mentioned side effects on issue #917, and that explain why `logger.consumers = initial_logger_consumers` exists.