allow purging local results as long as they are not outstanding

also switch to RuntimeError, not assert
test purging local results while some are outstanding
Merge pull request #4722 from minrk/purge-outstanding

allow purging local results as long as they are not outstanding