I used to get this alert once in a while when I disconnected the charging plug from my S2. And today it was as if it was a permanent behavior of the phone. Thanks to all you guys on AndroidForums! I fixed this with out spending a penny. It was so simple.
I cleaned the charging port with a small needle. It did have dusts and other stuffs on it. I also bent the pin to bring it to the center position with little pressure. The pin had bent to the lower side a bit. And I did all this with my phone switched on with blinking battery icon and at one time the blinking icon gave up. It was all stable and I switched off the phone to check the weird 'no switch off' issue. The phone did not switch on by itself. I guess I may have found the solution to this problem on my phone.
It's no way related to ICS or any other software. It's a hardware issue!!!