SRTP: code cleanup and minor optimisations