Chdir into root dir to prevent access errors after uid change (closes #3780)