Fix cp28386.

Add additional checks of the passed in mode.

I'd like some additional eyes on this one since it's a pretty fundamental part of IronPython (opening files).
FYI, I filed a bug against CPython on this: http://bugs.python.org/issue22802