Fix potential race condition with chunk retries and the bandwidth monitor