Check r and p against zero before dividing

These can be zero through a hash in crypto_pwhash_scryptxsalsa208sha256_str_verify and are never checked, leading to SIGFPE due to dividing by zero.