There's no known official origin of this phrase but there are tons of articles online with some serious research about it.  One myth was that the phrase "one for the road" was actually said to prisoners who were about to be executed.  That's a bit morbid.  One site...