No longer use onreadystatechange for synchronous requests

In order to comply with the documentation from Mozilla:
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#onreadystatechange
onreadystatechange is now used only when needed
(i.e. if the response is not available synchronously).

This is needed for synchronous requests on Firefox 3.6.