TS-1475 Add checks for getting metrics / configs for ts_lua. Coverity 1216788