Fires must be attended at all times!
There is no such thing as, "the best way to leave a fire unattended for a short time," your fire is either being attended, or your fire is thoroughly extinguished and your pit is left cold, no argument. There are no conditions where an open pit fire can be left alone and be 100% guaranteed not to spread. It's the people who ignorantly assume they can walk away from their fires who are often responsible for carelessly ignited forrest fires. My father is a fire captain in a small mountain town in the Canadian Rockies, his department is regularly called out all summer long to extinguish brush fires started by unattended fire pits.
If you have plans to leave your campsite after a meal then you should probably plan a meal that can be prepared without a fire, or which can be cooked using a stove, either that, or you prepare a small fire, just big enough to cook with, then extinguish it before you leave, you can still use your partially burned wood when you get back, just put it on top after you've got a new fire going again.
Not only is never leaving your fire unattended a universal rule, it's also a written rule in every park and campground. In some places it's even illegal, and you can be fined for doing it.
Edit (in response to OP edit to question): If the fire is hot (doesn't matter if it's above ground or below) then you cannot responsibly leave it unattended.
If you are planning to leave camp immediately after cooking over a fire, then you should to take those plans into consideration while initially building it. Use only as much wood as you'll need to cook, and start cooking as soon as you have some hot coals and the flames die down a bit. Once you start cooking, stop adding wood to the fire. The coals will burn hot for a long time, and provide you with a good constant heat if you build your fire right. When you're done cooking, kill your fire by spreading the wood out in your pit and exposing the coals. The flames should die almost immediately as the insulation provided by the logs is removed. Spread the coals around your pit and stir them into the dirt/ash beneath. At this point, soak the coals and logs, and continue to stir the coals around until they are cool enough to touch. If you can't put your hand on them, then they are still too hot to be left alone and can easily reignite themselves (I've seen fires come back to life long after they had been "extignuished"). Pour as much water as necessary onto your fire until it is cool enough to touch.
At this point, you may safely walk away from you fire. When you return, rebuild your fire with new wood, and use the burnt logs to either help build the base of your log cabin or leave them around your new fire to dry and add them on top after. The old wood will dry out quickly enough, and continue to burn to ash.