Check to ensure tempfile exists before :close!

Quick fix for people experiencing 3952 and probably other things.
Initially appeared to be a problem with how we resolve binary
content, but even an improved method resulted in tempfile being
nil.

It may also be worth addressing the binary_contents? method.