fix Issue 12523 - wrong type deduced for foreach ref argument

- only take storage class const/immutable/inout from the foreach argument

- the foreach argument type already has the the element type modifiers