stmhal: Add file.flush and os.stat.