Fixes #3123 - Correct name length control in datalist_get and set_config

It's 1.9 branch version of https://github.com/Elgg/Elgg/pull/495
Ticket: http://trac.elgg.org/ticket/3123