Indeed, but I doubt that one could find a 'flow detector' which, itself, actually offered that functionality - the OP would still have to add some electronic logic (be it with the "latching timeout relay" {if one existed} that the OP mentioned or something else).Flow detector on the output. If it detects flow for an excessive length of time it shuts down the pump.
Kind Regards, John