Fix type matching for functionType so return wildcard is properly matched

Problem here is that match is not simmetric as source can match against
wildcards but not vica versa. In function it is more tricky. Previous
implementation take arguments and return value same way, but that cause problem
with matching function like any(boolean) to integer(any) that actually match
(because you want pass boolean, that is fine and want anything, so also integer
is fine), but old matching alghorhytm incorrectly mark it as unmatched.