Before replace event tweaks

`$.pjax.state` is inconsistently set before push and popstate `pjax:beforeReplace` dispatches. Lets ensure its always set to the latest state beforehand.

However, that leaves me with still wanting a clean way of getting the previous state in this hook. Really, for beforeReplace, "previous state" is the relevant state. Ideally, I'd like `location.href` to be the previous url in a `beforeReplace` handler, but thats not really possible for `popstate` consistency.

/cc @mislav 
Before ee0887cc959ce7f41ce1cc427da934c0b5b6e04d, `$.pjax.state` would return "hello" which is the old url.