fix bounds checking of findnext

`findnext(randn(10) .< 0.0, 0)` causes segmentation fault bacause
the start index 0 is out of bounds.
Merge pull request #6303 from bicycle1885/fix-findnext

fix bounds checking of findnext