Wait for shell when opening preferences page. Fixes #825