LockedPointer template class, to allow returning a held lock along with a pointer in a movable object.