gnutls: Build the certificate chain recursively instead of using a loop