fix infinite loop in bytes_cpy when size is zero

Beside this bug, I don't know if update_last_work() should call copy_work with zero-sized nonce2.