Segmented fetch update

 - Merged kibana/master
 - added tests for segmented fetch
 - fixed a segmented fetch race condition