Re-focus web view when leaving prompt/yesno mode.
Display IPC errors to the user.

Fixes #337.
Fix mode handling with multiple javascript prompts.

This fixes a regression introduced in 03ac8874ff3036069c72e96f6268235a34b26ea2.