helper: improve expr_equiv() to handle numbers
The expr_equiv() function is pretty awful. It just prints two strings
and does a strcmp(). Before was insisting that the "sym" pointer not be
NULL and since number literals don't have a sym, that meant they could not
be equiv.
The other problem is that expr_to_str() doesn't work correctly for a quite
a few types of complicated expressions. I added a hack around for that.
And finally if you call a function twice, that function could have side
effects so even though they look equiv they are not. For example,
if (foo->read() != 'A' || foo->read() != 'B') {
The first read returns A and the next returns B. But they're counted as
equiv in expr_equiv().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>