EMS firms pivot to defence, industrial electronics amid margin pressure