util.c: Check whether generate_random() was invoked successfully
util.c: Check whether generate_random() was invoked successfully

This evaluates the return code from generate_random() within
write_chalresp_state() and returns immediately in case of an error.

This fixes #161.

Yubico/yubico-pam,eworm-de/yubico-pam,eworm-de/yubico-pam,Yubico/yubico-pam,Yubico/yubico-pam,eworm-de/yubico-pam