Added fsync to job file handling to prevent unrecoverable states