Set hostname and IP address from dockerinit

As requested by @crosbymichael, this is split out from #3015.  This moves the hostname and IP address setup out of the lxc tools and into dockerinit.