TST: fix an intermittently failing test case for special.legendre

Test used assert_equal on floating point numbers.