Bugfix for two issues affecting task lookup in Linux-specific code

Small fixes :
1) PGD to PID lookup was failing due to use of incorrect offset.
2) PID to PGD lookup was (occasionally) failing if task_struct->mm == NULL at time of observation.

Also a cosmetic refactor of related functions; behavior unchanged and API unaffected.