As per, data channel readyState is set to closed synchronously, which prevents to fire the onclose event.
As per https://jsfiddle.net/uoLzbn17/, it appears that Safari does not fire the event but Firefox (and Chrome apparently as well) do.
https://bugs.webkit.org/show_bug.cgi?id=303052 mentions a usecase where it is useful for web apps if the event would be fired.
We should figure out which behaviour we want and align implementations.