Fix potential fd leak

Always close the test socket.

Change-Id: Ic87b713a7791cf39ed5146754e1345fc662c894e
Merge "Fix potential fd leak"