Wow... I had this exact problem. I mean, exactly: every time I'd press the "end" button, I'd hear a little click. Drove me nuts. I kind of jury-rigged the solution, but it works perfectly:
Take off the battery cover, and look for where the cover locks into place on the phone, where it clicks (I'm sure you've looked at this area enough times by now). Place a tiny (I used like .5 cm-square size) piece of tape on the phone, directly over the little area that isn't locking properly. (I attached a pic of what mine looks like with the battery cover off.) Just make sure, obviously, that the tape isn't covering any of the phone that won't be covered by the battery door.
I used basic masking/painter's tape, but if yours is really loose, you could use maybe a tiny piece of electrical tape? Don't know, but the whole point is just basically to "shim" that edge out, so the cover has a little more pressure on it (as it should) to keep it from moving.
Not the most glamorous solution, but you can't see it with the battery cover on, and like I said, I haven't heard a peep out of it since I did this.