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

Test used assert_equal on floating point numbers.
Merge pull request #4179 from rgommers/fix-legendre-failure

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