I agree: strictly speaking, π/2 is not a solution because tan(π/2) is undefined. Apparently, WolframAlpha simplifies the equation and in the process acquires spurious solutions. The same happens with tan(x)cos(x) = 1.
Yes, WA can be wrong. I don't know the extent of it, but see here for a simple integral which it gets wrong. The solution, of course, should be log|x| + C, not log(x) + C.
Always check your answers. Even when using a fancy "calculator" like WA.
-Dan