Add non-blocking API to TlsProtocol

This PR supersedes #68. It's not a split of that PR, it's a complete rewrite that has a cleaner API and less invasive changes. The TLS-SRP changes will be done as part of a separate PR, as requested.