dm: sync with nearly all v3.9-rc1 DM changes

Only things held back were the hlist_for_each_entry and idr changes.