bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779)

3 files changed