Replace history and location when xhr response status is 40x.
Replace history and location when xhr response status is 40x.

webkit has a bug in history state api. It occurs when 404 page is pushed to
history state and then reload the page.
This commit escape the bug with code retrieved from jquery.pjax.

schneidmaster/rails-turbolinks,bmxpert1/turbolinks,infinum/turbolinks,maclover7/turbolinks,jvenezia/turbolinks,LOTSIX/Turbolinks,christhekeele/turbolinks,jasnow/turbolinks,arigesher/turbolinks,philiptzou/turbolinks,Thibaut/turbolinks,WojtekKruszewski/turbolinks,Thibaut/turbolinks,jnillo/turbolinks,maclover7/turbolinks,activebridge/turbolinks,rstacruz/turbolinks,Thibaut/turbolinks,rstacruz/turbolinks,activebridge/turbolinks,monkbroc/turbolinks,caulfield/turbolinks,activebridge/turbolinks,smd686s/turbolinks,imton/turbolinks,jasnow/turbolinks,naveed-ahmad/turbolinks,celsodantas/turbolinks,rails/turbolinks,mizchi/turbolinks,johnnyshields/turbolinks,jho406/turbolinks,jdurand/turbolinks,Ju2ender/turbolinks,gmalette/turbolinks,Novik/turbolinks,ngpestelos/turbolinks,caulfield/turbolinks,linesarefuzzy/turbolinks,missive/turbolinks,glittershark/turbolinks,monkbroc/turbolinks,naveed-ahmad/turbolinks,smd686s/turbolinks,monkbroc/turbolinks,maclover7/turbolinks,celsodantas/turbolinks,caulfield/turbolinks,rstacruz/turbolinks,turbolinks/turbolinks-classic,monkbroc/turbolinks,elia/turbolinks,hexacyanide/turbolinks,naveed-ahmad/turbolinks,mizchi/turbolinks,rails/turbolinks,saboyutaka/turbolinks,rails/turbolinks,celsodantas/turbolinks,schneidmaster/rails-turbolinks,schneidmaster/rails-turbolinks,savef/turbolinks,elia/turbolinks,saboyutaka/turbolinks,jho406/turbolinks,dvdhsu/turbolinks,maclover7/turbolinks,christhekeele/turbolinks,savef/turbolinks,imton/turbolinks,jnillo/turbolinks,jasnow/turbolinks,arigesher/turbolinks,jvenezia/turbolinks,elia/turbolinks,mizchi/turbolinks,naveed-ahmad/turbolinks,woto/turbolinks,Novik/turbolinks,eileencodes/turbolinks,ngpestelos/turbolinks,jnillo/turbolinks,celsodantas/turbolinks,gmalette/turbolinks,gmalette/turbolinks,peterjm/turbolinks,saboyutaka/turbolinks,DrewMartin/turbolinks,rstacruz/turbolinks,tomichj/turbolinks,Novik/turbolinks,smd686s/turbolinks,jvenezia/turbolinks,bmxpert1/turbolinks,jnillo/turbolinks,glittershark/turbolinks,Shopify/turbolinks,saboyutaka/turbolinks,smd686s/turbolinks,savef/turbolinks,garbles/turbolinks,jasnow/turbolinks,mizchi/turbolinks,lepture/turbolinks,jho406/turbolinks,rails/turbolinks,WojtekKruszewski/turbolinks,missive/turbolinks,arigesher/turbolinks,fukayatsu/turbolinks,garbles/turbolinks,turbolinks/turbolinks-classic,mirego/turbolinks,imton/turbolinks,ngpestelos/turbolinks,peterjm/turbolinks,turbolinks/turbolinks-classic,WojtekKruszewski/turbolinks,LOTSIX/Turbolinks,elia/turbolinks,savef/turbolinks,Thibaut/turbolinks,activebridge/turbolinks,jvenezia/turbolinks,WojtekKruszewski/turbolinks,ngpestelos/turbolinks,envato/turbolinks,arigesher/turbolinks,missive/turbolinks,DrewMartin/turbolinks,jho406/turbolinks,gmalette/turbolinks,twalpole/turbolinks,missive/turbolinks,imton/turbolinks,turbolinks/turbolinks-classic,lfender6445/turbolinks,schneidmaster/rails-turbolinks,Novik/turbolinks,caulfield/turbolinks