Add the file and line number when reporting a duplicate resource

The default error message will only tell you where one of the duplicate
resources is, when it's sometimes possible to report on both saving
having to search through the code to find the duplicate.