[FLOC-1021] Implement restart policy in flocker.node._docker.

https://clusterhq.atlassian.net/browse/FLOC-1021
I think it is much easier to see what is going on in the function if the entire definition is right here, rather then part of it being way up at the top of the file.