lxd/api/internal: Wait for daemon to finish starting up before shutting down in internalShutdown
lxd/api/internal: Wait for daemon to finish starting up before shutting down in internalShutdown

Otherwise we can end up causing a panic.
This maintains the same behaviour as the daemon's signal handling which doesn't react to signals until the daemon has started up.

Signed-off-by: Thomas Parrott <6b778ce645fb0e3dde76d79eccad490955b1ae74@canonical.com>

lxc/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,hallyn/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,hallyn/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,lxc/lxd,hallyn/lxd,lxc/lxd