A Game-Theoretic Approach for Minimizing Security Risks in the Internet-of-Things