`@lock.flock do` should auto-unlock