Make ResultMerger safe in parallel environment

With current implementation, sometimes two processes write to the same JSON file, and collapse it.
My fix avoids this problem, and loads JSON with error check.