sh: Remove global state from collate_range_cmp().
The global state is not used across invocations of collate_range_cmp().