US snack maker Lance has signed an agreement to merge with pretzel firm Snyder's of Hanover.