mkapi: simplify decl2str. fix wrong result if no var