optimize restore & use Getenv less in daemon.go

This minor cleanup PR reduces the use of Getenv in daemon/daemon.go:restore and removes the registerContainer closure.

This was originally done together with creack, but it had to be rewritten after some code was changed.