test-cases: Fix hang when computing the root package
test-cases: Fix hang when computing the root package

The code that computed the root package of all packages under test was
buggy.  Depending on the order of the packages supplied to test-cases,
it was possible to enter an endless loop.  This PR fixes the issue.

Fixes #307

Signed-off-by: Mark Ryan <f16215f7acd0bd7fdc465539215bd574c785b062@intel.com>

wcwxyz/ciao,obedmr/ciao,matthewrsj/ciao,ciao-project/ciao,mrkz/ciao,rbradford/ciao,obedmr/ciao,tpepper/ciao,leoswaldo/ciao,erick0z/ciao,erick0z/ciao,obedmr/ciao,tpepper/ciao,01org/ciao,wcwxyz/ciao,mcastelino/ciao,mcastelino/ciao,01org/ciao,markdryan/ciao,rbradford/ciao,leoswaldo/ciao,jorgevgut/ciao,mrkz/ciao,mcastelino/ciao,matthewrsj/ciao,wcwxyz/ciao,jorgevgut/ciao,kaccardi/ciao,kaccardi/ciao,leoswaldo/ciao,jorgevgut/ciao,mrkz/ciao,markdryan/ciao,erick0z/ciao,matthewrsj/ciao,tpepper/ciao,ciao-project/ciao