Implement pool file locking

This uses the underlying lockf() C call, and requires some libstdc++
trickery to get to the file descriptor used for a file.  This should
be fairly safe, and generate a compile error if the implementation
details change to where it wouldn't work.

It seems to work correctly with clang, and to segfault with gcc.
pool: Redo locks with libc-only calls

Don't try to use streams, just open the file descriptor directly.
This will be portable to anything with a 'flock' call.
pool: Move file locking to its own class

Clean up the pool code a little by moving the locking itself to a new
class.
test: Move build_sizes into tutil

Make available for other tests.
build: Use ninja-buildl

Make default rules build with ninja-build.
pool: Use forward_list for files

forward_list can work with something that is not MoveInsertable, which
allows us to construct the File structures directly in the list,
rather than needing pointers to them.  It's probably fairly
irrelevant, regardless, since the list will use pointers to the next
element.
pool: Implement pool writing

Basic pool writing support.  There are some basic tests, with some
TODO comments of additional things to support, such as newfile, and
index recovery.