Add null checks to browser callbacks

There were reports with a couple crashes in testConnection due to a race
condition where we've disconnected the browser before the callback
completed. In that event we should consider it an error state.

Fixes: 159961110
Test: atest
Change-Id: I4fc58ad9ac39e4264ff52c05ff0aeab4e26b3638
1 file changed