Update gpio.py

fix setting direction
fix read after write (reset file pointer after write)
Merge pull request #2 from gdeback/patch-1

Fix settings direction, reset file pointer after write.