Fix use after free bug in vvp when a task or function is disabled.
Fix use after free bug in vvp when a task or function is disabled.

Use test_joinable() and do_join() to ensure everything gets cleaned
up before the thread is reaped. This should fix br1016, br1017, and
br1018.

themperek/iverilog,themperek/iverilog,themperek/iverilog