More test for IO::Stream
Fix RAF jpeg preview.
Don't leak XTrans Pattern.
Remove tr1 from cfapattern
Use shared_ptr for Stream to avoid leaks.
Fix the memory leaks in the RAF parser when there is an error.

All the streams are used with a shared ptr now.

Merge branch 'raf-leak'

Conflicts:
	lib/raffile.cpp