Added check against the use of the same ref multiple times

Using the same `ref` multiple times can cause some pretty weird things to happen (usually resulting in the last component using the `ref` to be set for an owner's refs) as discussed here: https://github.com/facebook/react/issues/1782
Ah, yep. Sorry, I lazily copy-pasted some of spicyj's code. Will fix if this PR is needed.