s3-librpc: make gensec result handling more generic