common/os: fix null pointer dereference on nrec
common/os: fix null pointer dereference on nrec

pf_profiling_record checks that nrec is NULL, however, a subsequent call
from this function to profiling_recbuf_update dereferences nrec by a read
and a write.  Fix this by checking if nrec is NULL and returning early
in profiling_recbuf_update to avoid the dereference bug.

Fixes warning from clang scan-build:

common/os/pfwrapper.c:380:6: warning: Dereference of null pointer (loaded from variable 'nrec')
        i = *nrec;
            ^~~~~

Signed-off-by: Colin Ian King <d100aa70785e45ee8deab668147d941941915c21@canonical.com>

intel/numatop,01org/numatop,ColinIanKing/numatop,intel/numatop,ColinIanKing/numatop,ColinIanKing/numatop,01org/numatop