Save current working directory during recording and restore it (for the tracee) during replay.

This ensures a relative path passed to the initial execve() is resolved
correctly. There are potential problems with changing cwds that this does not
fix (see issue #1188) but we'll leave those for another day.