A few tweaks to actually make it work on systems without ithraeads.

Managed to work on this with a perl that was compiled without
support for ithreads and found a few issues. These should now be
resolved, and all tests should work on both thread-capable and
non-thread-capable systems.