Add iterator test, fix invalid free of slice memory

Keys and values returned from iterators are not allocated by malloc and are
not owned by the caller, so calls to free cause problems.
Merge pull request #8 from edsrzf/iterator-fix

Add iterator test, fix invalid free of slice memory