Fix logic for updating global secondary indexes

 - The logic didn't cater for cases when we only update secondary indexes in `updateTableAndWait`.