Molecular line survey of the high-mass star-forming region NGC 6334I with Herschel/HIFI and the Submillimeter Array