Add attribtes to datalist options

for https://github.com/joomla/joomla-cms/commit/51138ffadfa55cea2652cff465aa012e025d6e22#commitcomment-6621908
Using suggestionlist is not an option. The whole point of the previous PR was to get rid of it because it's broken beyond repair. It has a wrong method signature and produces faulty output.