make extension apis tolerate browser absence during start-up & shutdown

Note: I was never able to directly reproduce the 13082 bug, the error mode is clear (there was no selected tab during a call to tabs.getSelected()). This fix will address that issue and we should stop seeing this crash reports.

R=erikkay
BUG=13082

Review URL: http://codereview.chromium.org/119117

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17631 0039d316-1c4b-4281-b951-d872f2087c98
5 files changed