Intellectual Property Rights, Imitation, and Foreign Direct Investment: Theory and Evidence