Why would someone be out of their "cotton picking" mind?

When did this saying arise - and why?

stales