change: to use libgen API in basename_lua and dirname_lua functions.
fix: should not modify lua string.