Investments and the holdup problem in a matching market