Flush log buffers if HostFactory.New()/Run() throws an exception.

The reason the same as #196, but happens at other places.