core: Remove error and close handlers before ws restarts.
Merge branch 'release-0.12.x' of github.com:zotonic/zotonic into release-0.12.x