Make sure the tld writer is closed properly after usage

Fixes the issue discussed in (already merged) https://github.com/icoloma/tldgen/pull/3