Fix mis-used of file handles https://sourceforge.net/p/webadmin/bugs/4344/