imv-os: Properly free strings for invalid input in pacman