Fix #9 restoring of cwd

The s:origdir variable was local to the source file. Since all functions used
the same name for the variable to save the old working directory, restoring did
not work with nested function calls as one call would overwrite the restore
value of a function invocation higher up the stack.

This was fixed by replacing s:origdir with a local variable l:origdir