WASHINGTON — In a rare moment of bipartisan agreement between the White House and Congress on a major national security issue, the House passed legislation on Thursday that aims to end the National Security Agency’s bulk phone records program that had prompted intense domestic debate about privacy and civil liberties.