Smart I/O Modules for Mitigating Cyber-Physical Attacks on Industrial Control Systems