testing/server: calling return after http.Error

Fixes the "multiple response.WriteHeader calls" warning.