Ensure i/o gc thread is stopped before returning from _wapi_cleanup