#1261: Look for duplicates in db directly.

Unix filesystems are case-sensitive. Which has proven to be a problem.