Improve gen-locales.mk and gen-locale.sh to make test files with @ options work