When check_check is used with --clear-needs-check-flag option,
device needs to be opened in RW exclusive mode, but for this
existing RO exlusive open must be closed.
LVM2 will consider version 0.5.3 as a version without flag support
for cache_check since it cannot successfully pass cache_check.
TODO: when 'RO' parts detects there is nothing to 'clear' it should
completely skip RW open to avoid udev rule processing.
We had a cycle from transaction_manager <-> space_map, and also from
the ref_counters back up to the tm.
This prevented objects being destroyed when various programs exited.
From now on we'll try and only use a shared ptr if ownership is
implied. Otherwise a reference will be used (eg, for up pointers).