Backporting MassIndexer fixes to 4.4

These are all cherry-picked from master.

Essentially we need HSEARCH-1260, the other two issues are later improvements on the same work.