image.mk: fix make variable/command context leakage between LegacyDevice templates