Merge "Fix use-after-free errors in stdio_test."