Unused Op-Amp in Photodetector setup, but only occasionally
There is nothing more you need to do.  Your circuit without the diode is stable all by itself.  R2 provides DC feedback so that the output will be driven to the same as the positive input, which is ground.

Think of it this way.  Your circuit is basically a transimpedance amplifier.  By disconnecting the diode, you are feeding 0 current into the transimpedance amplifier.  0 current is a valid signal in this case, and no different from the diode being in the dark.

Also, the datasheet is being too specific about what to do with unused opamps.  You want to drive them so that they don't pick up noise or oscillate, but otherwise use little current.  There are various ways to achieve this.  They only show some examples.