Added patch to avoid crashing when broken app tries to release surface although refcount is zero.