Later loop detector: anti-hang up on boot

https://bugs.gentoo.org/show_bug.cgi?id=391945

IMHO, this's much more dirty and hackish way than the early loop detector (https://github.com/OpenRC/openrc/pull/12). I even not sure in this code (in contrast of early loop detector). But this may be used in conjunction with that one to do not hang up on unsolvable loops (need-loop).