gh-143460: Skip infinite recusion tests for infinite stack size (#143606)
Avoid tests being killed due to OOM on Linux if a system is configured with
'ulimit -s unlimited' by skipping tests relying on infinite recursion.
While unclear if Python should support 'ulimit -s unlimited', we should at
least try to avoid failing a PGO build running tests due to an unlimited
stack size being set.
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>