I know that this is an actually feature, where hoppers don't remove items from the bottom slot of the furnace, as well as they only put there fuel.
When that comes in with lava, it changes a bit, since they don't remove the bucket. That may also be a feature, so that the player don't waste any lava, and restarts the system by simply remove the empty bucket (according to this setup). I know that this is simple to make, since you only need to detect one item
My system works this way:
First, I placed a furnace with 2 hoppers facing it (up and beside) and one below it. On the upper one, I've placed the items to "cook" and on the other I've places the lava buckets. When the system runs out of fuel, it can't restart because the bucket is clogging the system.