builder: Handle trailing \ appropriately.

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

builder: Handle trailing \ appropriately.