Close curl connections even if there's an error