[PATCH 5.10 433/545] tools/thermal: Fix possible path truncations