builder: Fix CMD to inject /bin/sh -c when provided with a non-json value

closes #8264 

/cc @aanand @tiborvass