Remove duplicates when transitively adding library dependencies.

When not doing that, the number of redundant linker arguments can reach
enormous values rather quickly. For instance, the size of Qt Creator's
build graph on Linux goes down by 10 per cent due to this change.

Task-number: QBS-435
Change-Id: I772fc6a6c90696b5d0a3e0ebd65315cf0773552f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>