use stricter mutex policy to prevent installed.json corruption (#635)
use stricter mutex policy to prevent installed.json corruption (#635)

* use stricter mutex policy to prevent installed.json corruption

* move locking before installed.json read
arduino/arduino-create-agent,arduino/arduino-create-agent,arduino/arduino-create-agent,arduino/arduino-create-agent