[libdune]: fix on_dune_exit to handle thread exits
[libdune]: fix on_dune_exit to handle thread exits

Before, an exiting thread would terminate the whole process due to
calling the exit_group system call. Now, we call the exit system call.

project-dune/dune,project-dune/dune,project-dune/dune,project-dune/dune