* Don't set errno when calls are successful (will slightly alleviate the problem
of errno not being thread-safe yet).
* Transfer errors returned from size() and seek() into errno.
* Fix isatty() - could never return 1 from a FileHandle.
* Use more appropriate errors than EBADF in some places (eg ENOENT for non-existant path).
This patch fixes the declaration of the DIR type and related functions
so that they can be called from C code. This is necessary when enabling
functionality that uses the filesystem in mbed TLS.