gitignore: Make paths relative to repository root.

Paths without the leading slash apply to all subdirectories, which especially
means that /tests/data is ignored, making it unnecessarily hard to add test
data.
Merge pull request #3897 from bantu/gitignore

gitignore: Make paths relative to repository root.