ext: GC safety fix when throwing an exception