Implement reference_internal with a keep_alive
reference_internal requires an `instance` field to track the returned
reference's parent, but that's just a duplication of what
keep_alive<0,1> does, so use a keep alive to do this to eliminate the
duplication.
diff --git a/example/issues.py b/example/issues.py
index 12b46b7..facdafa 100644
--- a/example/issues.py
+++ b/example/issues.py
@@ -95,3 +95,17 @@
print_NestB(b)
print_NestB(c.b)
print_NestC(c)
+abase = a.as_base()
+print(abase.value)
+a.as_base().value += 44
+print(abase.value)
+print(c.b.a.as_base().value)
+c.b.a.as_base().value += 44
+print(c.b.a.as_base().value)
+del c
+gc.collect()
+del a # Should't delete while abase is still alive
+gc.collect()
+print(abase.value)
+del abase
+gc.collect()