(PUP-914) Use resource ref when writing dot files

Use the `ref` attribute of a resource instead of `to_s`.

Internally, Puppet uses the `ref` attribute to identify and locate resources
within a catalog. This patch makes use of `ref` to identify nodes in graphviz
output as some Types, notably Whit, override `to_s` and either destroy or
obscure the identity of resource nodes.
Merge pull request #3223 from Sharpie/pup-914-use-ref-in-graph

(PUP-914) Use resource ref when writing dot files