Add counting capability to MeshSharedPtr, MeshFunctionSharedPtr, SpaceSharedPtr.