pbrpc: properly free collections and handles