Federal employees and their office buildings are facing an increase in threats at a time when the agency sworn to protect them is running into challenges to fill law enforcement vacancies.