Change fread() and fwrite() calls in leo_mem_*().

Instead of reading sizeof MAGIC_NUMBER bytes 1 byte at a time, read them
all at once.

This change is primarily to simplify error checking.