MB-5307: made atomic_write_file be more atomic
MB-5307: made atomic_write_file be more atomic

I.e. it now fsyncs before rename.

Change-Id: Ic05cfae5d7a32042c4b3f66193b7eec14a9d5b14
Reviewed-on: http://review.couchbase.org/20772
Reviewed-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>
Tested-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>
Reviewed-by: Aliaksey Artamonau <3c875bcfb3adf2a65b2ae7686ca921e6c9433147@gmail.com>
Reviewed-by: Pavel Blagodov <596b71e626fc58dbdad141b817770e3e4810bb9b@gmail.com>

nimishzynga/ns_server,ceejatec/ns_server,vzasade/ns_server,pavel-blagodov/ns_server,mschoch/ns_server,mschoch/ns_server,membase/ns_server,pavel-blagodov/ns_server,ceejatec/ns_server,nimishzynga/ns_server,membase/ns_server,ceejatec/ns_server,daverigby/ns_server,vzasade/ns_server,t3rm1n4l/ns_server,vzasade/ns_server,nimishzynga/ns_server,membase/ns_server,nimishzynga/ns_server,ceejatec/ns_server,pavel-blagodov/ns_server,mschoch/ns_server,membase/ns_server,vzasade/ns_server,ceejatec/ns_server,membase/ns_server,daverigby/ns_server,daverigby/ns_server,t3rm1n4l/ns_server,t3rm1n4l/ns_server,mschoch/ns_server,mschoch/ns_server,mschoch/ns_server,pavel-blagodov/ns_server,t3rm1n4l/ns_server,daverigby/ns_server,membase/ns_server,t3rm1n4l/ns_server,daverigby/ns_server,ceejatec/ns_server,nimishzynga/ns_server,nimishzynga/ns_server