Fix more random test failures
TEST Trac #16746: Use the Sage displayhook in doctests