Add _safe iteration tests, implement kdlist_for_each_safe_rev