What safety mechanisms prevent thrust reverser deployment in mid-flight?
On a Boeing 777, the thrust levers need to be at their idle stops otherwise the thrust reverse levers physically cannot be moved aft. Once the thrust levers are at their idle stops and the  reverse levers are moved to the reverse thrust position there will be three signals provided to the thrust revereser actuation system (TRAS). 

These three signals to the TRAS energize the thrust reverser sync lock valve
(SLV), the directional control valve (DCV), and the isolation valve (IV). At a reverse thrust lever angle of 11 degrees, the SLV is energized by closing a microswitch in the thrust lever assembly. The SLV then sends hydraulic pressure to the sync lock on each thrust reverser sleeve to accomplish release.

At 24 degrees reverse thrust lever angle, the DCV is energized by a microswitch in the control column assembly where the thrust levers and reverse thrust levers reside. The valve is shuttled by system pressure to the deploy position.

At thrust resolver angle of &lt;31 degrees the IV is opened by a signal from the electronic engine control (EEC), and system pressure, by way of the DCV, is ported to the actuators. The IV command, from the EEC, also requires the engine to be running and the airplane to be on the ground.

Air/ground logic uses radio altimeter signals, with ground mode for the thrust reversers being &lt; 5 feet. The locks within the locking actuators release and the thrust reverser sleeves move aft. After the thrust reverser sleeves move aft by a measure of 60%, interlock releases and the levers can then be moved to their maximum reverse thrust position.