Fixes #3683: Move r28837 to v1.7 branch

---svn-pre-commit-ignore-below---

r28837 [[BR]]
Based on a patch submitted by Piotr Lesnicki of Bull, cleanup the PMI2 support. This has not been tested yet on multiple environments (e.g., Cray), so it needs more evaluation prior to moving to the 1.7 branch.

cmr:v1.7.3:reviewer=rhc


r28841 [[BR]]
Cleanup a variable that isn't used if pmi2 support is available

Refs #3683


r28843 [[BR]]
Sigh - fix a couple of spots I missed

Refs #3683
Fixes #3684: Move r28842 to v1.7 branch

---svn-pre-commit-ignore-below---

r28842 [[BR]]
This has apparently been wrong for some time! Fix the common/pmi libraries so we build them dynamic so they can be properly linked into the components that use them. Define required library version numbers  and so some other cuteness to make it all work.

cmr:v1.7.3:reviewer=jsquyres
Bring over r28849 to get trivial fix for PMI-1