US Army veteran also visited the city twice in months leading up to truck attack, law enforcement officials say.