Do the synchronous flush of the leaf pages after writing leaf pages for
all of the files, give the asynchronous flush as much time as possible
to work.

Don't release the files until after the synchronous flush completes, I
can't convince myself it's safe, and it shouldn't cost us anything.
Merge pull request #1358 from wiredtiger/write-leaf-pages-3-pass

Minor rework of the checkpoint write-leaf code.