capture_output: move to test/ext
capture_output: make it a generic minitest ext