gc_collect_cycles(): fixed possible segfault. Improved auto-gc performance.