#150 cleanup cursor when a txn is retired
remove junk debug code
#152 test case for MDEV-5399
#152 bug fix for MDEV-5399
#152 bug fix for MDEV-5399
#152 bug fix for MDEV-5399