Fix lifetime bug with some uses of WiredTigerItem
Use temp session for WT_SESSION->compact

Because compact doesn't work inside a transaction
This fixes jstests/replsets/maintenance.js