Don't screw up refcounting if unregistering a previously unregistered activity is attempted. gitlab #841