session: remove segment if empty after writer lock