[v13.x] Backport thread-safe function deadlock detection fix
requested to merge github/fork/gabrielschulhof/backport-deadlock-detection-to-v13.x into v13.x-staging
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines