Fix memory leaks in psa, reported by CI.