Moved im_waiting_for_flush call to end of remove_txn_set_from_graph.
Added PageTest.WriteWaitForFlush test, which hangs, revealing a bug.

It was a known bug from looking at the txns.find(*jt) != txn.end()
comparison being the opposite of what it should be, in
page_cache_t::remove_txn_set_from_graph.
Fixed inverted comparison in page_cache_t::remove_txn_set_from_graph.