core: add `thread_get()`

Remove PID check duplication in `thread_getstatus()` and
`thread_getname()`.
Merge pull request #1580 from Kijewski/thread_get

core: add `thread_get()`