[FLOC-727] Design sketch of restart-policy handling.

Supersedes #984.
See comment elsewhere; I think this should be standalone function in `_docker.py` that can handle all three.