app/testpmd: check for valid socket id when attaching port