err:
if (session->dhandle != NULL)
WT_TRET(__wt_session_release_dhandle(session));
__wt_free(session, config);
__wt_rts_history_final_pass uses session->dhandle to decide whether we need to release the dhandle. It is wrong as we may get the dhandle but failed to lock it. In this case, we will unlock the dhandle without locking it.