Fix GC crash with gob/parent handling

Tests in core-test adjusted.
This fixes [CureCode issue #1969](http://issue.cc/r3/1969).