kernel: rework Initramfs locking logic
Rework CompileImage/Initramfs locking logic to fix race condition on
concurrent access/compilation.
Rework each intermediate step and group them under one single execution
block. Protect this with a new lock, 'gen-initramfs' and rename the
compile initramfs to compile-initramfs lock name.
This is done to handle corner case scenario where a rootfs with the same
hash ID is generated at the same time. To handle this, we execute
everything under lock and use a specific hash ID lock to prevent
concurrent access/compilation.
Link: https://github.com/openwrt/openwrt/pull/16404
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>