Shrink DependencyCollector#parse_symbol_spec and add tests
Add :libltdl dep for libtool's libltdl

The :libtool dep is implicitly a build-time dep; :libltdl can be used
for software that uses the ltdl library at runtime.
imagemagick: depends on libltdl

Fixes #17732.