This reverts commit 582635b0. The segfault issue has disappeared, so the workaround is not needed anymore.