uniform_int_distribution exist in the namespace boost as well as in std
of C++11. Use the one provided by boost.
This fixes compilation bugs with CXXFLAGS=-std=gnu++11 together with
gcc 4.8.3 and boost 1.55.
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).