gpio: fix memory leak

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>