Import readutmp and getcwd changes from gnulib.