E-commerce discounter Overstock.com will buy Bed Bath & Beyond’s intellectual property and digital assets for $21.5 million.