Court hears alleged threats of man who caused terror alert onboard flight