Metasurface-in-the-Middle Attacks: Wavefront Manipulation Threats and Countermeasures