core: Fix msg_send_receive

Fixes #1935
core: introduce `thread_priority_t`

Throughout the code base a thread priority was stored in `uint16_t`s,
`char`s and `int`s.

This PR introduces the typedef `thread_priority_t` and the format macro
`PRIthread_priority`.
Fix missing `restoreIRQ()` before `sched_switch()` in semaphore.c
core: add `thread_priority_higher()` convenience function
core: `PRIORITY_MIN` is the least priority for a *user* thread
core: sched.c did not compile with DEBUG=1
core: let `sched_switch()` evaluate if the current thread is on the runqueue
core: msg.c did not compile with DEBUG=1, better messages
core: [in] parameters should be const in msg.c
core: always check if the target has a message queue
tests: add @authmillenon's msg_send_receive test