fix debug output of scheduler

When print the thread names, we should use "%.*s" instead of bare "%s".