Merge "Make RunAgentThread ensure thread attach is possible."