Properly handle refcounting with break/continue.