Fix CVE-2014-3470

Check session_cert is not NULL before dereferencing it.
(cherry picked from commit 8011cd56e39a433b1837465259a9bd24a38727fb)

Change-Id: If19c9037d3fb086bb913704e5e440ec7bc6e1e22
Fix CVE-2014-0221

Unnecessary recursion when receiving a DTLS hello request can be used to
crash a DTLS client. Fixed by handling DTLS hello request without recursion.

Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
(cherry picked from commit d3152655d5319ce883c8e3ac4b99f8de4c59d846)

Change-Id: I88ea85e2f3e166bc9eba1fef2127e1e0bb8c13c2