Datalist polyfill: Fixed polyfill so only displays value if value and label are identical and also corrected undefined checks (fixes #2823 and supercedes #2831).