Prevent overflow when computing Mid in binary searches.

library/array.m:
library/bt_array.m:
    As above.