Correctly check buffer length in netlink_add_attribute()