Fixing race in task secondary index.

Bugs closed: AURORA-667

Reviewed at https://reviews.apache.org/r/25133/