fix bug causing tsuru_unit_agent to freeze forever running restart hooks

TsuruLogWriter thread now exits after we call Stream.close, also restart
hooks make sure close is called after sending hook output.