avoid unnecessary DTLS restarts

fixes #47

thanks to szcom for debugging this