A fix in adaptivity.
Add counting capability to MeshSharedPtr, MeshFunctionSharedPtr, SpaceSharedPtr.