[PATCH 4.19 180/287] tools/thermal: Fix possible path truncations