When 5VIN is disconnected, the gates of Q6 and Q7 are connected to GND via R41-R8//R13-R14 (100k+100k//100k+15.4k = 165.4k). Vgs for Q7 is then larger than its threshold voltage and will turn on Q7. Q6 will only act as a diode in this case.
If you are adding a diode, break up the link between R16 and R41-C10-Q6S and place the anode on 5VIN. Perhaps also add a pullup resistor between G and S on Q7 to prevent any floating gates when 5VIN is disconnected.