Add null checks in navigator.serviceWorker access to fix possible crash

This fixes two possible crash:
1. document->frame() could be null when ServiceWorkerContainerClient::from is called
2. NavigatorServiceWorker.m_serviceWorker could be null in ServiceWorkerContainer::detachClient

BUG=355998,356017
TEST=fast/serviceworker/access-container-with-invalid-context.html

Review URL: https://codereview.chromium.org/217023003

git-svn-id: svn://svn.chromium.org/blink/trunk@170501 bbb929c8-8fbe-4397-9dbb-9b2b20218538