[WIP] Fix race between flush and Emit.

Emit() may be called from multiple goroutine.
flush() is also called from anther goroutine.
To protect buffer from race, single goroutine should handle all emit() and flush().

WIP: I have not run this code yet. Hopefully, I'll test in this week.
flush() 中に emit が止まらないように、 flush をバックグラウンドの goroutine で行います。
送信中の buffer に書き込みしないように buffer を入れ替えます。