[CrOS Network] Fix settings issue when Cellular dongle is removed.

When the user viewed the Internet detail page for a Cellular dongle
then removed the dongle from the machine, a JS error would occur which
caused the settings page to become broken.

This CL fixes this error by addressing two issues:
(1) When the page is closed, internet_page attempted to focus the arrow
    in the row corresponding to the device type associated with the
    network being shown in the detail page. However, when the dongle is
    unplugged, the Cellular device no longer exists. This CL performs
    this check before attempting to focus the arrow.
(2) If the dongle exists but is *not* connected, unplugging the dongle
    does not trigger a network properties change, so the page would not
    close on its own. This CL explicitly checks when a device has been
    removed from the system and closes the detail page if the device
    corresponding to the current network is removed.

Bug: 896222
Change-Id: I00518d04343bf38b7244b3b957b6d4aa76faf10e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533099
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642921}
2 files changed