Add helpers.fdatasync(); fix interleaved mmap/read-write in midx.

Have helpers.fdatasync() fall back to os.fsync() whenever
os.fdatasync() isn't available.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>