Fixed version check in case of different preferred state

When installing an extension with the `beta` state, the check to see if it's installed failed, because the `pecl list` command returns the version and state, but only the first is checked.

Also, improved the comments to reflect which pecl extension is being handled.
Merge pull request #5689 from pkruithof/patch-1

Fixed version check in case of different preferred state