Verify end was reached before special casing
Verify end was reached before special casing

As the `window_reflect_pos` could be `0` if the `half_length` is `0`,
check first that we reached the end of the source container and then
check if we have run out of values within the window to reflect. This
should avoid some other failure modes picked up by the tests.

nanshe-org/rank_filter,jakirkham/rank_filter,nanshe-org/rank_filter,DudLab/rank_filter,nanshe-org/rank_filter,jakirkham/rank_filter,DudLab/rank_filter,jakirkham/rank_filter,DudLab/rank_filter