[PATCH 5.15 114/145] scripts: handle BrokenPipeError for python scripts