phlsys_fs: Add atomic_replace_text_file()

Make it easy to atomically write files on POSIX compliant filesystems.
This can be useful where obtaining locks on files is not possible, e.g.
when writing files on NFS.

Test Plan:
$ ./precommit.sh

Modify testbed/reader-writer to exercise atomic_replace_text_file()
instead. Observe that readers always read a consistent state of the
file, although temporary files can be left behind.
testbed/reader-writer/run.sh: tidy, use for loops

Tidy up 'run.sh' by using bash for loops in place of lots of repetition.

Test Plan:
testbed/reader-writer/run.sh
Arcyd: write status files w/ atomic swap not lock

Instead of using file locks to ensure that reads of Arcyd's status files
are consistent, use the new atomic_replace_text_file() routine instead.
This enables us to share the status files across machines using NFS.

Test Plan:
$ ./precommit.sh

examine instaweb dashboard with
$ ./testbed/arcyd/test_shell.sh
phlsys_fs: remove unused *_file_lock_context()

The file_lock_context routines aren't used any more, remove them.

Test Plan:
$ git grep file_lock_context
$ ./precommit.sh
Merge branch 'feature/atomic_write2' into feature/atomic_write