cpp: libxtreemfs: making sure cert stack is not empty, logging number of additional certs, bugfix when writing cert stack