It just happened to me today when I clicked home burton like search in my iPhone 4S the keyboard remain and did not disappear even after pressing home burton a couple of time. it only disappeared after i click another app without keyboard. I replicate this a couple of time and the problem was still there.