Fixed a problem on DISCONNECT

The WiFi Direct sub-system exits the group before any disconnect packets
are sent out.

The solution however is not very elegant, as it involves sequentially
waiting for threads to complete before continuing.