device: Fix check for bonded devices
util: Silence fwrite on error
bonding: Rewrite the port hook and fix various errors
bonding: Improve robustness of the code