Fix multithread issue in localmsg API

OK, i thought the localmsg server is created by us for testing purpose only, i'll find out the solution and may add one more test for the one-server-two-clients case.