lua-factory: Prefer jhbuilt scripts to system ones

When building the list of system data dirs to read the scripts from,
make sure that we prefer the scripts in the first system dir mentioned
in XDG_DATA_DIRS. This fixes a jhbuilt grilo-test-ui loading the
system-wide script instead of the jhbuilt one when both exist.