Fix a load more things where SimplifyLibCalls will insert standard library calls with parameters in the wrong address space.

Note that many of these fixes are in code paths that are never reached because other code avoids the optimisation if the address spaces don’t match.