janssonrpcc: couple of pkg free in case of errors