Fix bug in merged iterator, release IW lock upon exception