Added spec for reopen with path closing fd.
Fixed IO#reopen with path.
Revert "Avoid caching singleton classes."

This reverts commit 977fe2ee0994836a0dbfb3e9c6c2f512cd7a2e94.
Revert "Singleton classes can't have subclasses."

This reverts commit f7e4f42b62404b71f7f18e24195a8bd15983b4e9.
Use WeakRef to link SingletonClass to object.

Since we cache SingletonClass instances in eg inline caches, we can retain
very large object graphs rooted in the object having a singleton class. So
we use a weak reference from the class to the object.