Avoid crash due to cookie jar being deleted when tab is closed