beifg: Simplify the implementation of be_ifg_foreach_node().