I have a hypothesis that, like minstrelsy and vaudeville, the threat of quicksand was a holdover from earlier, pre-film times. Specifically, I would bet that it traces back to the western emigration dating from the 1848 Gold Rush through the 1860s. Everyone who came West in those days took wagons, usually drawn by oxen, on one of a handful of major trails running along the great rivers of the Plains, and in those wide, undammed braided streambeds quicksand must have been a constant threat.
The great emigration left a deep stamp upon the national narrative, not least on those who made it to the promised land. They and their descendants brought waves of residents over the rails to Los Angeles and San Francisco, and when the first movie studios arose in California around 1920, the writers repurposed the living memories and sturdy memes from that not-so-long-ago timeand I think one of those easy licks was quicksand.