Previously this didn't work because Docker still creates missing target folders as root instead of as mapped user.
Manually creating the folder seems to fix that.
- Upgraded to 3.1.47.
- EM_CACHE override leads to some new issues with package search in sysroot, probably because sysroot is hardcoded in PKG_CONFIG* variables. Use Docker's path mapping mechanism instead.
- Added temporary workaround for new issue from https://github.com/emscripten-core/emscripten/issues/16836.