Only superuser can define a leakproof function

It is only the LEAKPROOF keyword that requires super user access, and it is a small optimization. You can leave the function in but remove the word LEAKPROOF.