Fixing various style problems
Reduce scope of local variables

https://travis-ci.org/RIOT-OS/RIOT/builds/36579191#L1209
Set PIDs initially to KERNEL_PID_UNDEF

Suggested by Oleg Hahm