[pacman] don't reinstall if it is not needed

Use the option --needed when installing packages to avoid re-installing a package if it is already at last version.