Check that safari tab and window are non-null.
Fixes #49.