Fix query retry on stale connection error.