Close the unneeded filehandle in closure filehandle handlers

It seems in some situations this code can deadlock, so close one obvious
possible source.