Fixes #1870: _.indexOf with `isSorted` of `true` will incorrectly match `undefined` on an empty array.

Addresses @jdalton in #1870. Doing a check for the array's length.