Fixed bug where reaching end of outputfile the global mutex would be left open and block the server