fix 2 problems on Jython 2.x (#849)

(1) Stop using os.O_NOFOLLOW since it might not exist if the platform
    is not GNU or POSIX prior to 2008.
(2) Jython 2.5.x/2.7.x cannot handle directories by os.open()