Don't free messages if a write error occurred