Fix the exception raised in _SingularResource.__init__ so that the
message matches the key used.

resource_type raises a NameError here as it is not present in the scope
of the __init__ method.