gpio: fix memory and reference leaks in gpiochip_add error path