Enable thread protection

This patch enables thread protection for MonoMac similarly to MonoTouch. The maccore patch depends on an accompanying patch to monomac.