lib/curl: clean and sort options