Use native dialog box for credentials

Split from my master branch to review and merge separately.
This code will be used by the proposed subtitles downloader framework.