handling missing permissions for cwd()

If for some reason there is a command running that does not belong to us
(the yadtreceiver user) then getcwd() will fail with an error. This
patch allows returning a default value if that is the case.