api/server: replace an integration test with a unit test using engine mocking.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
engine: fix engine.Env.Encode() to stop auto-guessing types.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)