Button one’s lip/button up
To stop talking or keep quiet about something dates from the mid-19th century.