Improve docs for tempname() and tempdir()

backport of 74f67560f4428b1febddcd45972281efa46923ce