client: add Context*-based wait_on_list/signal_context_list helpers

These are better when the list may need to be deallocated.  Context's are
single-shot and the list is not referenced by the caller.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
client: signal mds sessions with Contexts instead of Conds

If we try to open an mds session and the MDS responds with close (aka,
"no"), we call _closed_mds_session() which signals the Cond*'s but then
deallocates the list.  wait_on_list() then does a use-after-free trying
to remove itself.

Instead, use Context*'s, so that the waiter does not reference the list.

Fixes: #5689
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>