If you installed using apt-get (as you should have) OH is running as the openhab user. That means the openhab user must have permission to read and write to /var/run/ and /var/run/dht.lock
You can but you have to add the openhab user to sudoers and configure it so it doesn’t not require a password to run sudo.
I’ve no exhausted with wiringpi so I’ll be off limited help but I think this means you need to run the script root. This means you need to add openhab to sudoers and configured to not need a password.