If quit() has been called, driver.toString() returns null:
>>> FirefoxDriver: firefox on XP (null))
Otherwise, it returns a hashcode of the object:
>>> FirefoxDriver: firefox on XP (9f897f52-3a13-40d4-800b-7dec26a0c84d)
so you could check for null when assigning a boolean:
boolean hasQuit = driver.toString().contains("(null)");