Don't hold the checkpoint lock when flushing leaf pages

@agorrod, @michaelcahill, an attempt to avoid holding the checkpoint lock until after flushing the leaf pages.

It's only lightly tested, but so far seems to work.

I have a couple of open questions I'll comment on in the code.

Anyway, if you get a chance, please let me know what you think and if this approach seems good to you.

Reference #1114.
I wouldn't bother making changes at that level: Alex's branch handles `NEED_SWITCH` in a different way.