Surfaces now track whether they're supposed ot be freed. Fixes #27