Fixed timeouts and added noblocking write

* Fixed timeouts for non-blocking read
* Added non-blocking write (fixes short write errors)

- Special thanks to Srinivasu for reporting this