Update purge_builds.py after bug 991230. (Also includes changes from bug 861733 that were never imported.). r=catlee

--HG--
extra : rebase_source : 2b81dcae2693c1a88c013b02dbaa8669fb91528c