Use logoutTargetPid instead of current pid for logout

If current PID is used, logout could link to an access restricted page.