Properly reap children in tests on MRI and Java

Fixes #54