Fix #635 - Duplicate rows with slow sorting

When the grid is sorted quickly the results of both queries appear in
the grid. Add call to `cleanupContent` when each query has returned.