Fix R package building on Linux

Fix non-portable mktemp usage.