fix 'eb --list-toolchains'

`eb --list-toolchains` was spitting out most toolchains multiple times

This patch fixes the problem and enhances the unit test to avoid it happening again.