Fix goog.array.flatten to work with large subarrays

Note: I have not signed the Google CLA, so please ignore this pull request for now.