ui: look before you leap on sys.stderr.closed (and look nicer)
f83291e5643e introduced a fix if sys.stdout.closed does not exist.
This change uses a getattr with default instead of hasattr (which just calls
getattr) and accessing the attribute.
Additionally it applies the same fix for sys.stderr.closed as this is not
available in the bpython shell (reported by Roger Gammans).
localrepo: add optional validation (defaults to off) for incoming changes
This verifies that all manifests are present for incoming changes,
and all files for those manifests are also present. This is a simple
first-pass, and could be better, but seems like a valuable thing to
have, as I've seen pushes in the past that propagated revlog corruption.