[tools] mkimage: fix compilation on FreeBSD