Check return code of subprocess in build.py