Fix T38740: multi-user metaballs not rendering in Cycles.
Fix T38726: blender internal viewport render crash when deleting render layer.
Fix cycles standalone crash on Mac OS X.
Fix more of T38726: there still was a crash when deleting render layers.