Fix usage of equality operators for None.

That type of comparisons should always be done with
"is" or "is not", never the equality operators.