Fixes bug in HeapObject.removeReferringObject: replaces obj with obj.id
in remove operation on referringObjects set.