Close filehandle before re-open and do not use AnyEvent before fork for Win32 (close gh-6).