HMRC has allocated national insurance (NI) numbers to strangers who have since died, it has been warned.