fix for certain platforms/versions not having `os.O_NOFOLLOW`

fix for #849. 
this is critical for the PEP453 effort in python 3.4:  http://bugs.python.org/issue19749

needs confirmation from another person, as it contains a fair amount of tedium
I did add new tests.

cc  @d1b