[pacman-dev] [PATCH 1/2] Ensure handle is valid and pm_errno is reset when calling into API