Fix for #1528 and #1527: for loop optimisation for arrays

- Fix boxing
- Call Array.unsafeItem for non-primitive arrays as that deals with the magic
- Do not unbox the array if we don't know how the array treats its underlying array
Test for #1528, #1527: iterating Array of Doubles