[release/6.0][wasm] Change dotnet.wasm link optimization (#60632)
* [wasm] Change dotnet.wasm link optimization
Context: https://github.com/dotnet/runtime/issues/60349
When we switched to Emscripten 2.0.21, we stopped using deprecated
`--llvm-opts 2` option. This caused unwanted performance degradation.
Switching to `-O2` get us similar performance as with `--llvm-opts`.
Blazor wasm test app `Time to first UI` benchmark times:
branch/commit link option time dotnet.wasm size
--------------------+------------+--------+-----------------
release/6.0 92ff02 -Oz 491ms 2,430,639
release/6.0 92ff02 -O2 457ms 2,474,518
release/6.0 92ff02 -O3 444ms 2,555,824
* Fix native build too
Co-authored-by: Larry Ewing <lewing@microsoft.com>