Bug 1058459 - [SMS] Data shared from other applications are not shown as Drafts until the app is killed and open again.  r=schung

Using localStorage as inter app communication bus.
> Is it possible that we send postMessage but never return the ack?

In current implementation idea - no, it's not possible as shared worker messages are processed by single class who always replies with ack.

>Maybe just need to close the port once event emit if it's a rare case and dead port didn't breaks functionality.

As I mentioned below, if we close port it will never receive any other messages (I'll check it to be sure). Imagine the case when we have SMS app №1 opened, then we save draft from Gallery activity (it's broadcasted and port in №1 is closed), after that if we try to save draft from any other activity, №1 won't receive these broadcasted messages anymore..

Regarding to "dead" ports - as I see it doesn't affect functionality as messages posted to "dead" port is just posted to "somewhere", but I'm worried about potential memory leaks (shared_worker -> port -> activity_instance), not sure how it's managed though.

IMO the best solution would be to close port once app is going to be closed\terminated\killed. Eg. inside ```worker_event_dispatcher.js```:
```
window.addEventListener('app-closing', () => Worker.port.close());
```

But I don't know if we have something similar to that ```app-closing``` event.