Implement unsubscribe

I've factored out `rpc/3`, at the expense of a couple of helper
functions.

I'm not sure how I'll handle puback and friends, in particular if I
want to handle them as RPCs (probably not?) so I've left them out for
now. Likewise message deliveries.