Make Firefox gracefully abort when a tab is refreshed or closed

Fix Firefox not disconnecting on refresh
- Change the withCredentials flag to only be auto-set when cross-domain is detected (can still be explicitly set)
- Conditionally do an async abort if the browser is Firefox 11+ AND withCredentials is true
#2489

Make Firefox gracefully abort when a tab is closed
- This change is only needed for cross-domain scenarios
- This does not work when the entire browser window is closed
#2517