Add third flag for open when using O_CREAT. Thanks to "robi" for reporting it and providing a patch.

Fixes #4596

Reviewed by rhc, RM-approved

cmr=v1.8.2:reviewer=ompi-gk1.8