[PATCH 4.14 261/293] perf session: Fix potential NULL pointer dereference found by the smatch tool