core: harmonizes the data type for the process ID

Instead of using arbitrary integer types use pid_t as provided by the
toolchain.

Closes #210.
`_xxx_r` are newlib glue functions, where the definition has to match the prototype.