Delete perms when deleting a udf

fixes #1131 on github