firmware-utils: mkfwimage: add -Wall, fix obvious bugs causing compile warnings