Don't use non-transitive comparator in std::set

Started with something that was way over-engineered and ended up with this.  By only keeping possible tips in setBlockIndexValid2, we reduce its size by a factor of 40, so a linear scan to find the best tip isn't as bad.