Use explicit tmpname rather than NamedTemporaryFile
(#299)