Detect references in foreach properly

Summary: Previously we would occasionally misdetect various constructs (e.g. $$foo) as
reference variables in foreach statements.

Fixes #4154

Reviewed By: @JoelMarcey

Differential Revision: D1664006

Signature: t1:1664006:1415379641:f0f3c61d02c8d89ae49396161e73fdc2110b0859