title: python selenium driver.quit() can not quit firefox browser if firefox_profile setted
body: <p>This problem really confused me a lot.
  I'm using python selenium do some automatic work. After the work done, i need to close browser(I must use firefox). And I know <code>driver.close()</code> is to close current window and <code>driver.quit()</code> will close all windows and exit browser. The problem is: it doesn't work for me if i am using <strong>python file.py</strong> to run my code, but work if I setup the driver in <strong>python console</strong>, here not work is to say it just close my url, but the firefox browser not exit. All above tests have setted firefox_profile. 
  More, i found if i don't set firefox_profile the first way to run my code also working. I think maybe it's a bug for firefox_profile. Wish someone to save my day.
  My code is just like:</p>
  
  <pre><code>profile = webdriver.FirefoxProfile()
  profile.set_preference('browser.download.folderList', 2)  # custom location
  profile.set_preference('browser.download.manager.showWhenStarting', False)
  profile.set_preference('browser.download.dir', download_dir)
  profile.set_preference(
      'browser.helperApps.neverAsk.saveToDisk', 'application/octet-stream')
  driver = webdriver.Firefox(
      executable_path=gecko_dir, firefox_profile=profile)
  driver.get(someurl)
  driver.quit()# which will close my session, my url, my current window but not exit browser
  </code></pre>
  
  <p>the versions i'am using:</p>
  
  <ul>
  <li>python     3.5.3 </li>
  <li>selenium   3.4.3 </li>
  <li>firefox    55.0.1 </li>
  <li>geckodriver   0.18.0</li>
  </ul>