Fix various memory errors on untrusted input in libsrtp

Please see the commit messages for detailed descriptions.