Removed risk of deadlock when closing access token dialog