backport safari fix to current version from:

https://github.com/browserstate/history.js/pull/270