Fix translation of user-defined functions

This fixes https://github.com/julianhyde/optiq/issues/228 and a new issue -- `max(udf(...))`

When deriving type of `SqlUserDefinedFunction` we might want to skip verification (i.e. override `deriveType`) since `SqlUserDefinedFunction` is already resolved.
I did not create such an override since very few classes have one and I am not sure if it is proper in particular case.