Close share dialog when clicking on 'share' button again. Fixes #674.