Export PATH and ERRNO_CODES from Emscripten. ### Description

Fixes #2577 by exporting `PATH` and `ERRNO_CODES` from Emscripten

### Checklists

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

package:
  name: openssl
  version: 1.1.1n

source:
  url: https://www.openssl.org/source/openssl-1.1.1n.tar.gz
  sha256: 40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a
build:
  sharedlibrary: true
  script: |
    emconfigure ./Configure \
      gcc \
      -no-ui-console \
      -no-tests \
      -DHAVE_FORK=0 \
      -DOPENSSL_NO_SECURE_MEMORY \
      -DNO_SYSLOG \
      -fPIC \
      --prefix=${WASM_LIBRARY_DIR}

    sed -i 's!^CROSS_COMPILE=.*!!g' Makefile
    make build_generated
    make -j ${PYODIDE_JOBS:-3} libcrypto.a
    make -j ${PYODIDE_JOBS:-3} libssl.a
    emar -d libcrypto.a liblegacy-lib-bn_asm.o liblegacy-lib-des_enc.o liblegacy-lib-fcrypt_b.o
    mkdir dist
    emcc -sSIDE_MODULE=1 libcrypto.a -o libcrypto.so
    emcc -sSIDE_MODULE=1 libssl.a -o libssl.so
    make install_sw

package:
  name: openssl
  version: 1.1.1n

source:
  url: https://www.openssl.org/source/openssl-1.1.1n.tar.gz
  sha256: 40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a
build:
  sharedlibrary: true
  script: |
    emconfigure ./Configure \
      gcc \
      -no-ui-console \
      -no-tests \
      -DHAVE_FORK=0 \
      -DOPENSSL_NO_SECURE_MEMORY \
      -DNO_SYSLOG \
      -fPIC \
      --prefix=${WASM_LIBRARY_DIR}

    sed -i 's!^CROSS_COMPILE=.*!!g' Makefile
    make build_generated
    make -j ${PYODIDE_JOBS:-3} libcrypto.a
    make -j ${PYODIDE_JOBS:-3} libssl.a
    emar -d libcrypto.a liblegacy-lib-bn_asm.o liblegacy-lib-des_enc.o liblegacy-lib-fcrypt_b.o
    mkdir dist
    emcc -sSIDE_MODULE=1 libcrypto.a -o libcrypto.so
    emcc -sSIDE_MODULE=1 libssl.a -o libssl.so
    make install_sw
