delegation-shell: generate delegated credential of correct type

There are several types of proxy credential.  Currently the delegation shell generates
a fixed type.

In practise, the chain of proxy certificates must be of the same type or some services
will reject the chain.

This patch updates the delegation client so it generates a certificate of the same
type as the most recent (top-most) proxy certificate.

Target: master
Patch: https://rb.dcache.org/r/7112/
Acked-by: Gerd Behrmann
Request: 2.9
nfsv4: get client from current session for v4.1

Target: master
Acked-by: Karsten Schwank
Require-book: no
Require-notes: no