Improve comparision of arrays with repeated or empty elements

`diff([ a, a, a ], [ a, a, a ])` incorrectly reports that all but the first element were changed when `a` is a non-empty object, and that all elements were changed if `a` is `{}`.

fixes andreyvit/json-diff#1