[U-Boot] [PATCH v2 3/4] tools: env: Refactor write path of flash_io()