fix container restart race condition

Finish container cleanup before setting the state to stopped.
Otherwise, for an application that exits quickly, a call to Restart
can allow Start to be called again before cleanup is done, resulting in
overritten data in the Container struct.
simplify the runtime Register reconnect logic

Refactor the Register code a little bit to make it easier to comprehend.
Merge pull request #2748 from jpoimboe/fix-restart-race-condition

fix container restart race condition
Merge pull request #2750 from jpoimboe/simplify-register-reconnect

Simplify the runtime Register reconnect logic
Merge branch 'master' into vieux_merge_master

Conflicts:
	runtime.go
don't import emport empty hostconfig
Merge pull request #2777 from dotcloud/fix_port_stop_start

don't import emport empty hostconfig
Merge branch 'master' into vieux_merge_master
Merge pull request #54 from shykes/vieux_merge_master

Merge from master