[PATCH 5.2 124/215] perf session: Fix potential NULL pointer dereference found by the smatch tool