clean up the context when a build fails

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #8038 from unclejack/failed_build_context_cleanup

clean up the context when a build fails