Struggling social gaming giant buys and files patents in preparations to enter the online gambling business.