This seems to solve issue #147 on Linux. Needs testing to make sure it doesn't break anything on Windows (although it can't possibly solve the issue there, since Windows doesn't fork).