Dollar gains for second day on Afghanistan, Delta variant worries