Freeing custom buffer created during canvas jpeg streaming.
Fixed memory leaks.