image: Protect shared deploy directory usage
Image deployment directory is shared between the targets with the same
machine name, but there was no any protection when copy bootables with
the same file names. So building multiconfig qemuamd64 targets can fail
with:
ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_copy_boot_files:
Execution of 'tmp/work/debian-buster-amd64/isar-image-base-qemuamd64-targz-img/1.0-r0/temp/run.do_copy_boot_files.31554' failed with exit code 1:
cp: cannot create regular file 'tmp/deploy/images/qemuamd64/isar-image-base-debian-buster-qemuamd64-initrd.img': File exists
This is caused by initrd file creation by the multiple
do_copy_boot_files instances.
To fix the issue additional lock introduced.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>