Revert "Fix error checking in MemoryFile."

This reverts commit 21525f716ca48308cd7520083d6cb0b1b5267758.