Make sure the popstate event is only added once.