Use C.GoBytes instead of C.memcpy

I noticed that there was memcpy used a few times where C.GoBytes was more
appropriate.

Also remoted a few unnecessary unsafe.Pointer casts.

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>