Merge changes from topic "libsnapshot_write_atomic"

* changes:
  libsnapshot: write files atomically
  libsnapshot: lock on /metadata/ota