Check for updates only if document has focus. Fixes #229.