Fix `TestRestTemplate` so that any custom `ErrorHandler` isn't lost when calling `withBasicAuth`. Fixes gh-7441