Check yum package was actually installed

Here's my attempt at a small change to address https://github.com/ansible/ansible/issues/5327. Have done a quick test on CentOS 5 and 6. Someone that knows what they're doing should probably have a look as well ...