m.sync: Also use result index when creating failure callback