exit pthread fn_recv cleanly