Fix a couple of problems in multi-process.

Apparently parameters are not guaranteed to outlive local variables in a
function.
Don't connect again for every new file.