Refactoring of daemon/* code to support exec and related features

This PR should not affect any existing functionality.

@crosbymichael : As per your request, I have extracted out the refactoring part of #7409 into this PR.


Yes, it's kinda a hack because we have to pool lxc-info to get the actual container's pid instead of just looking at the `exec.Cmd` 's `Process.Pid`.  Im not sure of a better place to move this right now.