Refactor sending of challange messages

Also delete outdated comments.
Improve error checking in SESS_KEY handling
Rename len to srclen - it's more precise
Don't use static variable to store incoming session key

Also make receive_skey more readable.
Remove wait_for field

It is useless.
Simplify send_ack
Simplify ACK handling
Remove garbage
Simplify is_*_ready() functions