Slightly improved the build script

to delete the private key file when build process fails.