Make sure we don't add a dependency twice.

Some packages list dependencies twice: once in the depends part, and again in
the imports part.  We only need to track a dependency once.