Fixes call to equals() comparing different types

Quick fix to a major violation reported by Sonar here: http://clinker.netty.io/sonar/drilldown/issues/io.netty:netty-parent:master?severity=CRITICAL#