gen_init_cpio: Avoid race between call to stat() and call to open()