server: Set the context flags in get_thread_context to indicate which parts of the returned context are valid.