Fixed #23930 -- Copies of captured_std* from CPython's test.support

Please see [#23930](https://code.djangoproject.com/ticket/23930).