Close job's logging file when done

This solves a bug that prevented deleting the job's log in windows when removing the job