rerun fetchRootConfiguration when device becomes online (#14470)

- Refactor the way html5 events are ignored when cordova comes
  available.
- Hearbeat was not correctly started when network comes online.

Change-Id: I257d7b9d76e1107109654745b3a2c5a54bc86db0