More work on the block_os_threads test (adding verification code, fixing atomic issue).