[PATCH 5.9 006/105] tools/bootconfig: Fix to check the write failure correctly