Fix unittest compilation with --disable-curve25519

This is a fix for 9700, which we already fixed in 0.2.5.x, but which
got left in 0.2.4.x.

This is a partial backport of a0a855d586d99540277014ccd3
Merge remote-tracking branch 'origin/maint-0.2.4'

This is an "ours" merge, taking nothing, since we already had the
changes that were in a83abcf5ee5cb8fe245bc97e0