bus/ifpga: fix memory leaks in scan