Fix tests in buildbot and memory leak with allow_gc=False

NEWS.txt
- Fix memory leak with allow_gc=False (Frederic B., reported by Jan Schlüter)