Replace direct io syscalls with stdio

 Using stdio may help performance by:
 - reducing syscalls
 - Use buffering to preserve block size aligment (usually 4KB)
 - On 64-bits platform, on the readside, stdio may even use mmap to improve
   performance.