fix error with capturing locals for a foreach using a ref

Summary: a foreach expression can introduce a new local variable as a reference.
GetLocals during naming was not checking for this.
Fixed this by creating a separate GetLocals for foreach that also allows a ref (a ref is not a
valid lvalue anywhere else).

Reviewed By: @jwatzman

Differential Revision: D1674885

Signature: t1:1674885:1415757288:975a8b74a7c6ecef2f52da891c4e2530116738db