Unset referenced variable in foreach loops