Fixed issue with setResponseHeader when using synchronous requests

When using synchronous requests, the readyState was not properly changed to HEADERS_RECEIVED which caused getResponseHeader to always return null. Due to this behaviour the Content-Type could not be determined in setResponseBody and responseXML was created for all types of content.
Merge pull request #243 from goligo/master

Fixed issue with setResponseHeader when using synchronous requests