FS-24: Made the filesyncmanager correctly close the fileoutputstream. This prevents the file from staying locked.