The following adjustments are also made as a result: - Use int to check if lock is held and unlock is needed, given that for non-async requests we don't need to obtain a lock. - Protect access methods getOutputStream and getWriter with the same locking and state checks. Closes gh-32340