server: Fix the status code for get/set_thread_context on a terminated thread.