Thousands of Army troops and their families were alerted to a 'Lee Rigby-style' threat at their base after an administrative error by police.