core: refactor check for valid pid
core: add doxygen header for kernel_types