[CodeCompletion] Fix ASAN failure when completing in parameter packs
Whe completing in parameter packs, we were calling `getParameterAt` with `Res.FuncDeclRef`. But the substitution map in `Res.FuncDeclRef` contained type variables that were allocated in the constraint system’s arena. And that arena had been freed when we call this from `deliverResults`.
The fix is to compute the optional parameters in advance in `sawSolutionImpl`
rdar://109093909