subrepo: use safehasattr instead of hasattr
Some of these instances could be rewritten as clever getattr(x, y,
default) ladders, but that felt like it impeded readability too much
to be worth the modest efficiency gain.
Testing that hghave does not crash when checking features $ "$TESTDIR/hghave" --test-features 2>/dev/null