The posix_fallocate call on Linux is corrupting already written data,
add locking around it and the ftruncate call when either are being
used to extend the file in chunks.

Add configuration support for the Linux-specific fallocate() call, it's
the only one that doesn't appear to corrupt already written data.