set headers after xhr open to prevent invalid state exception

Is done in the test (GET) but not in the send method (POST), according to spec headers must be set between open and send.