$stdout is a shared data of all threads, so we must exclude other threads when it modify.
Since multi-threads may call Output.insert at same time (e.g. Core.error), it may causes a race condition.
Merge pull request #150 from authorNari/protect_insert_from_competition

Output.insert should be exclueded