safe pop in garbage collector thread

closes #439