.gitignore: Simplify references to the same file in different directories

Unless a .gitignore pattern is anchored, it'll match in any directory, not juts at the top level.  Simplify .gitignore accordingly.
Merge pull request #3193 from joshtriplett/patch-1

.gitignore: Simplify references to the same file in different directories