Generalize error message used by both `cargo package` and `cargo publish`.
Resolves issue #3061.
This pull request updates the wording of the error message in question to be applicable to both `cargo package` and `cargo publish`, and adds a test case for the example in the issue description.