Foreign direct investment, patent filings and firm performance