How to prevent MOSFET from operating in high resistance part of linear mode?
A simple, modular, and robust way to get better behavior from a circuit when the input is in an invalid state is to place a Schmitt trigger between the exposed input and the driver. A Schmitt trigger is (almost) guaranteed to produce a logic high or logic low even if the input is at an invalid intermediate level, weak, or floating.


Note that the integrated MOSFET driver that anrieff's answer mentioned has an internal Schmitt trigger in its input logic (denoted by the ⎎ symbol).
If your existing circuit is adequate at the actual job of of driving the MOSFET when the input is 0 V or 5 V as intended, then you can add a Schmitt trigger in the form of an inverter, buffer, or other logic gate that has a Schmitt trigger input, preceding your driving circuit.
As a further example of their use, Schmitt triggers are also commonly used in microcontroller inputs to protect the internal logic — ordinary logic gates can misbehave, and even draw excessive current and overheat, when the input is invalid, whereas a Schmitt trigger turns an invalid signal into some valid signal.


Another hazard specifically for driving MOSFETs (or any power transistor) that is not solved just by using a Schmitt trigger is if the input is is commanding the driver to switch on and off rapidly (whether this is deliberate, as in PWM drive, or accidental noise). Then the MOSFET will spend more of its time in the middle of switching, and so dissipate more power. To reduce this you must either avoid such frequent transitions reaching the driver (probably the better option, if needed at all, in your application since your loads might also be unhappy) or ensure that the driver switches very fast (low rise/fall time).