The crypto_sign_open() function accepts the signature and message as a single parameter. The first parameter is a scratch buffer it uses to compute the result. The original implementation was trying to pass the message in place of the scratch buffer, which is wrong. This change corrects the previous oversight. Running under valgrind now detects no memory corruption.
I still have the sneaking suspicion there's something wrong with this code. I was, at one point, getting segvs, but now attempts to reproduce them, even under the scrutiny of valgrind, are failing. I'm committing it for now in hopes of reproducing the issue on Travis.