An investment group has struck a deal to buy The Weinstein Company's assets, just days after the world-famous film studio looked set to file for bankruptcy.