Fix stalls and deadlocks in the standalone curl tests.