[PATCH 5.10 074/104] scripts: handle BrokenPipeError for python scripts