Prevent packing of duplicate packages

If you call "package-install" on an already-installed package, it no
longer adds a duplicate entry to the Cask file. A test is added to
confirm the behavior.