Fix some weird timing issue.

On OSX the popup was still visible as a separate window after switching
tabs.
Release v1.0.5.