builder: ONBUILD triggers were not accurately being executed in JSON cases.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Merge pull request #8547 from erikh/onbuild-cmd

builder: ONBUILD triggers were not accurately being executed in JSON cases