Surfaces, factories and gfxdevices are now refcounted.

Signed-off-by: Tord Jansson <tord.jansson@gmail.com>