Support check mode with pacman module

This change adds support for check mode with the pacman module.

I also opened #3875 which will probably conflict with this. Let me know if you want to merge them both and if you want me to provide a combined diff with both features.