compat/os2threads: support the return value of joined thread