US general says he will ‘take appropriate measures' after Trump social media threat