Government will tell social media firms to take down posts more quickly after attacks on masts.