Fix leaking test classloader

Fixes #338.