i agree with tim, except that, growing up in alabama, i was aware of the racist connotation of the term.
on a more official note, the OED says:
a coon’s age: emphatic for "a long time".
it was first seen in print in 1844.
apparently, early on, "coon" could refer to a "sly, knowing fellow." the first published use of this meaning was in 1832. thirty years later, it was first employed as derogatory slang for "negro."
as for whether to use it…it definitely depends on your company. i am certainly known to toe the line when it comes to appropriateness, but i wouldn’t use it in most circles. as a matter of fact, i’d only use it with some of my best friends who KNOW i’m not a racist. and usually, if i have to put that much thought into something, i just don’t do it at all!
hope this helps.
david