Prevent possible NPE with closing Mesos driver.

Add conditional check around Mesos driver prior to closing to avoid a NPE.