Avoid the "bool" flavor of compare-and-swap primitives: clang 3.5.0 produces bad code.
Flush checkpoint handles prior to taking schema lock.

This should save time when flushing again while holding the schema lock.
Merge pull request #1351 from wiredtiger/checkpoint-sync-early

Flush checkpoint handles prior to taking schema lock.