Barnes & Noble to buy Microsoft’s Nook business stake for about $123 million to pave way for its spin off.