Use open file descriptors to retain file between prepare and marshal phases

Fixes #4