[SPARK-4467] Partial fix for fetch failure in sort-based shuffle (1.1)

This is the 1.1 version of #3302. There has been some refactoring in master so we can't cherry-pick that PR.

Author: Andrew Or <andrew@databricks.com>

Closes #3330 from andrewor14/sort-fetch-fail and squashes the following commits:

486fc49 [Andrew Or] Reset `elementsRead`