Use boost fstream functions for all duk file operations
Use boost fstream functions for all duk file operations

Part 2 of a fix for issue #183.
Convert the remaining STL file operations into boost fstream
operations so that the file paths can be properly converted
from UTF-8 on Windows.
Refactor the read/write functions into a single implementation
to avoid code duplication.
Use smart pointers to properly clean up in the case of failure.

Robo210/hadouken,Robo210/hadouken,Robo210/hadouken,Robo210/hadouken