Fixing panic on log after close

and allowing close to be called multiple times without blocking forever.