Fix closing null curl connection