Otherwise things break in case of a Python venv, where the python.exe
is in a different location, or in a test suite, where an uninstalled
exe is run in the build directory.
Fixes#16129
This should not change anything in openssl.
The leak fixes synced in were already fixed in openssl,
and single_path_relocation() is the same as the custom code
in openssl.
openssl 3 added a new path from which DLLs can be loaded at runtime,
currently the "legacy.dll".
This code path was missing the relocation support and looking for
the CI build path instead, resulting in code that tried to load
the legacy providers to fail (examples: python-cryptography, transmission)
It can also be reproduced via:
openssl list -provider legacy -providers
Add relocation support to MODULESDIR to fix this.