v.22.4Bug Fix

Fix bug in 'if' function causing logical errors due to type mismatches

Fix bug in function if when resulting column type differs with resulting data type that led to logical errors like Logical error: 'Bad cast from type DB::ColumnVector<int> to DB::ColumnVector<long>'.. Closes #35367. #35476 (Kruglov Pavel).