StdoutCapture: Browse weakref only if they actually are weakrefs.