Backport WeakSet for 2.6