Use std::set since it never invalidates on insert()

When flushing handles, it can happen that new handles are added to the
set. This mainly happens for cases where we flush an RArray handle,
because that also gets handles for all elements in the array.

std::tr1::unordered_set doesn't give the insert guarantees we need,
namely:

Iterator validity

On most cases, all iterators in the container remain valid after the
insertion. The only exception being when the growth of the container
forces a rehash. In this case, all iterators in the container are
invalidated.

So if a rehash is forced, all iterators are invalid. This means we have
undefined behavior that can result for example in crashes (which was
happening in the Nokogiri test suite for example).

std::set explicitly states it doesn't affect iterator validity, so it
doesn't suffer from this problem. The downside is less performant
insert() but there isn't really another option without redoing this
completely.
Prevent having to search twice when adding handle to slow handle set

This uses the return value of the insert to determine if the value was
already in the set or not, so we only reference it if it was newly
added.