SIGSEGV thrown in end phase of pytest with jpype 1.5.2

To reproduce:

in test dir, run

uv run python -m pytest .

Casues a core dump. Seems to be something with race condition in closing JVM stuff.

Reported to JPype, but needs more investigation: https://github.com/jpype-project/jpype/issues/1261