Part of #44151,
Continuation of #51835,
Just moves existing state related url utils to kibana_utils plugin
Also fixes small regression introduced in #51835,
When sharing hashed url directly it should show error toast instead of full page fatal error
# Conflicts:
# src/legacy/ui/public/chrome/api/sub_url_hooks.js