kconfig: Fix malloc handling in conf tools