Fix `pthread_self()` confusion

This fixes #755.

The pthread ID cannot be reused as soon as the thread ends, because
another thread needs to join it first. `pthread_self()` uses the native
(i.e. RIOT's) thread ID to distinguish itself. A native thread ID can be
reused as soon as the thread ends, since the core knows no join
operation.

In order to not confuse itself with an earlier zombie thread (i.e a dead
non-detached thread, that was not joined, yet), we need to invalidate
the associated native thread ID.

This approach is sane since a dead thread won't call `pthread_self()`
anymore.
test: added missing license
Merge pull request #761 from mehlis/test-pthread-license

test: added missing license
make calloc "usable" early on

closes #741

Old versions of the gnu libc uses calloc to allocate dymanic memory
when some error occurs in dlsym.
This results in a segfault as natives calloc wrapper has not been
initialized yet.
As this is a circular dependency and the libc can cope with this, we
just return NULL from the calloc wrapper and hope for the best.

Recent libc versions use a static buffer instead.
move global char array out of thread

The char msg[] is accessed from outside the main thread after it has
exited, so it needs to outlive it.

Fixes #717
Merge pull request #763 from LudwigOrtmann/issue_717

move global char array out of thread
Merge pull request #758 from Kijewski/issue-755

Fix `pthread_self()` confusion
Merge pull request #762 from LudwigOrtmann/issue_741

make calloc "usable" early on