Optimize SortedSet#take_while/#drop_while for speed

This code is slightly slower when *all* elements are being dropped, but in
the majority of other cases it is much faster.