Port MRI logic for "check funcall" used by type conversion.