(#17842) Return meaningful errors with invalid resource references

Normally this kind of thing isn't allowed:

    file { '/tmp/foo':
      ensure => present,
      require => Mymodule::foo['bar'],
    }

However puppet lets it slip by when someone uses create resources:

    create_resources('file', { '/usr/local/homeaway/api-favorites-ustst1-jdk/java' => { ensure => present, require => "Mymodule::foo[bar]" }})

With the puppetdb terminus, our relationship checks fail when this kind of
delcaration is used, however in the compiler terminus it slips through because
I believe the comparison is done all in capitals.

Since the parser stops it, it shouldn't be allowed. However, our behaviour is
confusing to the user. This patch adds a more meaningful error message to this
kind of failure, instead of stating that it is a relationship error we stop
earlier with an error about the format.

Signed-off-by: Ken Barber <ken@bob.sh>