Fix bugs:
-Pairing message window not closed after paired.
-Pairing message should be able work in multi-thread context.