Pop your clogs

I know this means to die but how did this phrase come about?

Replies