Add newlines to the JSON stream functions

This makes the JSON streams a _lot_ easier to parse in less well-baked JSON parsers, and no less so in better ones.

Line-based JSON streams are very, very common, where simply chunk-based is not very common at all.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
registry: Added simple checksums (sha256) for layers

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
registry: Fixed tests

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
registry: Removed checksumPayload from exported fields

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
registry: Fixed unexported field

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Fix exit code issue with TTY mode

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Merge pull request #4346 from creack/fix_race_exit_code

Fix exit code issue with TTY mode
Merge pull request #4297 from dotcloud/add-simple-checksum

registry: Added simple checksums (sha256) for layers
Merge pull request #4276 from tianon/json-stream-newlines

Add newlines to the JSON stream functions