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
Revert "phlsys_fs: remove unused *_file_lock_context()"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

This reverts commit 230922ee8e2255b7eef611b7532bd3c598df82bb.
Revert "Arcyd: write status files w/ atomic swap not lock"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

This reverts commit 5636816ce8b767f093e2174459ca3040ad62659a.
Revert "phlsys_fs: Add atomic_replace_text_file()"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

Keep the tidy to use for-loop in 'testbed/reader-writer/run.sh'.

This reverts commit 43662d2c0cca9d8b567b2387eea7b039eaad3dc3.

Conflicts:
	testbed/reader-writer/run.sh
Add progress indicators to test scripts

The './precommit.sh' tests are starting to take a while, make it easier
to see what's going on by displaying a sort of progress indicator.

e.g.
    gen_doc: . ....... ...OK

In the event of failure, this also makes it easier to tell which of
the steps failed - by counting the pips and comparing to the script.

Test Plan:
$ ./precommit.sh

Determined which static tester was complaining in a particular case, to
look for instructions to ignore the individual instance of the error.
Add 'raw_call()' method to phlsys_conduit

In some cases we want to get the raw response returned from the conduit
API.  Expose a new method on the Conduit class that returns the raw
response and change __call__() to use that.

Test Plan:
$ ./precommit.sh
Exercised in subsequent commits
Add new prototype 'conduit-proxy' command

Make steps towards making it possible to grant limited admin API access
to users, based on custom rules.

Introduce a new prototype command 'conduit-proxy', which serves proxied
conduit via http(s) on a specified port.

Connections to the 'conduit-proxy' go through a trivial auth process
before being forwarded on to the real Phabricator conduit.

Separating the proxy auth process from the Phabricator auth process
means that Phabricator admin credentials may be kept secret.  It also
raises the possibility of introducing customised auth rules.

Teach phlsys_conduit how to connect to the proxy, this means that Arcyon
and Arcyd may use proxies without modification.

Test Plan:
$ ./precommit.sh

Added ./testbed/conduit-proxy/smoketest.sh to exercise the proxy
end-to-end.
Merge branch 'feature/conduit_proxy2' into feature/conduit_proxy