Simplified the memsearch/memory_access.h interface

As we are going to export it to Go in a single place, it makes more
sense to have a cleaner C interface and keep all the nasty code in
a single Go file.

Also, there is no need to have a read_memory function that allocates its
own buffer, that can be done in the Go wrapper.