runtime: fix prio_find_thread() ignoring missing threads

prio_find_thread() is not checking correctly for missing threads, and
may return nulls to the caller.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>