Close monitor socket after test