netlink: fix overrun in attribute iteration