Saves and restores current directory for detailed tests

I think fixing it with a save and restore is preferable to converting the given log file path to an absolute one, or immediately opening a handle passing it to stubWriteLog.