Fixed a refcounting error when parsing foreach statements.