Convert fceu/file.c to memstream-based