Fix query with nested array in Active Record

`User.where(id: [[1,2],3])` was equal to `User.where(id:[1, 2, 3])`
in Rails 4.1.x but because of some refactoring in Arel this stopped
working in 4.2.0. This fixes it in Rails. Fixes #16580.
[Dan Olson & Cristian Bica]

/cc @sgrif @matthewd @DanOlson @chancancode 
Why is it back up here again? I thought we'd lowered it, to affect handling of deeply-nested `nil` values?

And why the `uniq`?