Fixes for mds cluster

The last 8 commits modify the "mds to client" protocol. They fix some corner cases of exporting caps. The kernel counterpart is at https://github.com/ceph/ceph-client/tree/wip-mds-cluster.