fixing the hard coded action ports

The match port and output port for test case 40.40 were hard coded to 3 and 2 causing error in case the switch has openflow ports other than those. Changed it to take from the configured ports.