Don't free chunk.memory until after response parsed

The gmond would occasionally segfault, especially if the server was under memory pressure. This fix ensures the memory allocated for the EC2 API response isn't freed until it's no longer needed.