osd: do not leak HeartbeatSession on shutdown

Signed-off-by: Sage Weil <sage@inktank.com>
osd: break con <-> session cycle on reset

Signed-off-by: Sage Weil <sage@inktank.com>
mon: shut down Paxos on shutdown

This cleans up the completions for any paxos waiters.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: add is_shutdown() state helper/accessor

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: discard messages during shutdown

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: tear down version requests on shutdown

Make sure all callers can handle ECANCELED.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: use ConnectionRef throughout

Make RefCountedObject a private parent of Connection so that users are
forced to use ConnectionRef whenever references are taken.

Many methods can still take a raw Connection* when they are using the
caller's reference but not taking their own; this is cheaper than
twiddling the reference count, and the lifetime is still well defined.
Local variables generally use ConnectionRef, though.

Signed-off-by: Sage Weil <sage@inktank.com>
msg/Pipe: reset replaced pipes

This gives the ms_handle_reset call a chance to clean up (for example, by
breaking a con->priv <-> session reference cycle).

Signed-off-by: Sage Weil <sage@inktank.com>
msg/Pipe: include con reef in debug prestring

Signed-off-by: Sage Weil <sage@inktank.com>
common/RefCountedObject: take cct for debugging
osd: debug Session refs
debug refs on Connection
debug Pipe refs