Return the ifstream from agi::io::Open by move
Handle partial characters at the end of the read buffer when loading Lua scripts. Closes #1576.