The luxury e-commerce platform will narrowly avoid bankruptcy after the buyout from South Korea’s answer to Amazon.