fix EPERM when executing from a session leader