Prevent overflow in bucketize binary search
Summary: The current `median` calculation in the bucketize binary search is done in a way which is well-known to produce overflow issues ([link](https://en.wikipedia.org/wiki/Binary_search_algorithm#Implementation_issues)). This diff fixes the calculation so that overflows do not occur.
Test Plan:
Standard commit tests.
Also can test with:
```
#include <cassert>
#include <iostream>
#include <cstdint>
int32_t mp1(int32_t a, int32_t b){
return (a+b)/2;
}
int32_t mp2(int32_t a, int32_t b){
return a+(b-a)/2;
}
int main(){
int32_t low=-1;
for(int32_t high=1;high<10000;high++){
if(mp1(low,high)!=mp2(low,high)){
std::cout<<"Ahhhh!"<<std::endl;
}
}
}
```
Reviewed By: drdarshan
Differential Revision: D23993920
fbshipit-source-id: 6b4567515552092de5876de6cab77df27c9cf61d