[linux, macosx_common]: Prevent duplicates in links and libdirs via link_product_dependency calls.