Have LSM compact wait for in-progress merges to complete. #1259

@michaelcahill Please review these changes to compact and merging.  I found that compact was thinking all the work was done much sooner than it actually was, returning too early and not completing the compact/merges, when other merges were in progress.