gen_all_grammar: portability fixes

Instead of assuming that ROS_PACKAGE_PATH contains only one directory,
iterate through it correctly. Similarly, find the sub-directories
containing language models in a more portable fashion.