Taphephobia is the fear of being buried alive, which was a widespread concern in the 19th century. Irish patriot Daniel O'Connell left instructions not to be buried until they were absolutely certain he was dead. I'm guessing there was no more certain a way than waiting for decomposition to set in.
There were many accounts of 'revival after death', as well as evidence of premature burials. One example is of the incredible naturalist Frank Buckland's 16 day venture into the vaults of St. Martin-in-the-Fields in London, searching for John Hunter's coffin so the anatomist could be re-interred in Westminster Abbey. While down there, Buckland found evidence from at least 3 coffins that premature burial took place.
This prompted people to come up with precautionary measures to ensure their loved ones were adequately expired before interment. Cemeteries in Germany were often provided with a 'corpse house'. This was essentially a waiting room for the bodies to begin showing signs of decay so that they were able to be buried. Other efforts included contraptions where a rope was tied to the corpse's hand so if it were to move it would ring a bell above ground. There were also vaults where a body was kept inside for a number of days until they were absolutely ready for burial.
The German poet Gottfried Keller (1819-1890) wrote verses entitled Lebendig begraben or Buried Alive.
The top picture is of a body buried in the 1840's... however, the skeleton was found posed in a very distressed position suggesting this person was most likely buried prematurely. You can read more about it here.