clean up context on build completion & add test

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

clean up context on build completion & add test