Clear the X-Requested-With after the request has been sent

When the same session is used for other requests, the header contains X-Requested-With =  XMLHttpRequest, making the app think it is again an ajax request.