cmd/containers: End loop early when using the json option
cmd/containers: End loop early when using the json option

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #973
Approved by: TomSweeneyRedHat

nalind/buildah,TomSweeneyRedHat/buildah,TomSweeneyRedHat/buildah,projectatomic/buildah,nalind/buildah-1,ipbabble/buildah,nalind/buildah-1,rhatdan/buildah,ipbabble/buildah,nalind/buildah-1,projectatomic/buildah,rhatdan/buildah,rhatdan/buildah,TomSweeneyRedHat/buildah,projectatomic/buildah,nalind/buildah