lib/selection: be more careful with RO transactions
They probably couldn't hang open for long, as each client request should cause some cache-searching and thus close it, and even with queries stopping I haven't managed to find a case where it would be left open but... it's nicer to clean up and it should be very cheap.
No practical effect has been found (we haven't tried too hard), but I'd rather merge it anyway. In particular, we still keep seeing
[cache] LMDB refusing writes