Fixed several possible memory leaks.

 * Apply patch: https://issues.apache.org/jira/browse/AXIS2C-1586
 * Add stream_free functions to release memory.