Patches used in production by CMS

This is a couple of patches that CMS uses in production.

One is to have macosx working, the other one is to have a fork safe dcap. They were originally though for 2.47.5, but they still to apply to both 2.47.8 and the head. It would be great if they could be picked up and maintained officially, so that we can avoid doing so on our side.