fix searchsorted for sorted segments of arrays

This fixes `searchsorted` to work properly on sorted segments of overall unsorted arrays.

Without this patch:

````
julia> searchsorted(ones(15), 1, 6, 10, Base.Order.Forward)
5:11

julia> searchsorted([1:5, 1:5, 1:5], 1, 6, 10, Base.Order.Forward)
5:6
````


With this patch:

````
julia> searchsorted(ones(15), 1, 6, 10, Base.Order.Forward)
6:10

julia> searchsorted([1:5, 1:5, 1:5], 1, 6, 10, Base.Order.Forward)
6:6
````