use absolute paths for temporary directories

This works around an OS X.8 issue where os.path.realpath(d) resolves to
a different dir than d when d = tempfile.mkdtemp()

This PR supersedes #105 and #108