core: moved definition of KERNEL_PID_NULL

kernel_pid_t is defined in kernel_types.h, thus it makes sense to move
the macro for an invalid kernel pid there, too.
net: fix kernel_pid_t checks

KERNEL_PID_NULL is a negative number. If kernel_pid_t variables are
initialized to this value, one have to check for lt/gte 0.
core: renamed KERNEL_PID_NULL to KERNEL_PID_UNDEF

As @authmillenon pointed out the "null" in the old name is somewhat
misleading, since the actual value is -1.
initialize kernel_pid_t correctly
make kernel_pid_t comparisons consistent
ccnl: duplicate variable names

Some variables had multiple definitions, but could be removed or
declared with a smaller scope.
net: changed name of internal variable

To avoid naming conflicts + made variable static and volatile as it
should be.
tests: combine declaration and definition
fixed remaining variables to kernel_pid_t
Merge pull request #1549 from OlegHahm/kernel_pid_fixup

Handle kernel_pid_t consistently