Fix handling of multiple windows showing the same buffer.