dtls: rename dtls_prepare_record_header() to  dtls_send_handshake_msg()

This also removed the type parameter because it was always set to
DTLS_CT_HANDSHAKE.

This commit is a preparation for the next one making this function
actually send the handsahke messages.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: move handshake header preparation to dtls_send_handshake_msg()

Now dtls_send_handshake_msg() has its own buffer to store the
handshake header and it is possible to give dtls_prepare_record() an
array of elements like the header and the actual content in different buffers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: send every dtls handshake message in an own package

The sending is now done in a central position in
dtls_send_handshake_msg() and not by every function in an own call to
write.
Now the handshake messages of one flight are all send in an own package
and not in one big message. This should be improved later in
dtls_send_handshake_msg() to make it work for every handshake message.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: use dtls_send_handshake_msg() in dtls_send_server_finished()

Instead of preparing the handshake package by our own use the central
function to do so.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: use same function for finish message on server and client

Do not write the same function two times.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: use dtls_send_handshake_msg() in dtls_send_client_hello()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: move dtls_verify_peer()

later we are able to use dtls_send_handshake_msg() in dtls_verify_peer().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: use dtls_send_handshake_msg_hash() in dtls_verify_peer()

This also makes it possible to give dtls_send_handshake_msg_hash() an
own session struct and make it then work with peer == NULL.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>