Clean up WT_REF discard, do the work in one function instead of spreading
it out.