tools: mtk_image: split the code of generating NAND header into a new file