Fortran: fix two type mistakes

Use the appropriate modules, don't use mpif-config.h.

cmr=v1.8.2:ticket=#4736
If you don't specify all the rank-file mapping for all procs, then you'll segfault - which is probably a bad idea. I can't see an easy workaround, so just error out for now and let's see if anyone really cares.

cmr=v1.8.2:reviewer=jsquyres
Add some defensive programming, fix a typo
<laugh> ensure we really compare the things we want to compare
Protect against NULL return from malloc