Improve error message for duplicate objects

refs #6070