Fix deadlock issue while tearing down browser and none is opened.