Experimenting a bit with the snipped from comment #5, I can see the same happening for a xen based guest. One interesting fact here is that this is temporary only. So adding a sleep 1 between the umount and the sfdisk command will suppress that failure.
So it feels like umount returns while the kernel internally still cleans up. And trying to revalidate the partition table while this is not finished fails.
Experimenting a bit with the snipped from comment #5, I can see the same happening for a xen based guest. One interesting fact here is that this is temporary only. So adding a sleep 1 between the umount and the sfdisk command will suppress that failure.
So it feels like umount returns while the kernel internally still cleans up. And trying to revalidate the partition table while this is not finished fails.