Use File::Spec in the example to manually create tempfiles

Hardcoding both /tmp and environment variables is both prone to
error and not portable -- the example didn't work on Android,
for example.