Please look closely at the changes to __wt_session_get_btree. It took me a couple of goes to get them right, and it's possible that I haven't thought about one of the paths into this function.

Also, you'd suggested:
F_SET(session->btree, LF_ISSET(WT_BTREE_DISCARD_CLOSE));
Instead of the above three lines - should I change it?