Improve handling of durability of ClassAd logs.  #4283

This switches fsync to fdatasync where possible.  Also, ensure we
fsync the parent directory after performing rename().
Fixes and improvements from code review. #4283