Check if webDriver property exists before closing