US surveillance law to expire for first time after lawmakers reject Trump’s controversial pick to lead spy agencies