to avoid such a scene happening, take a complete round of your car before you open it, and even if you notice such sound, For God's Sake turn off the engine and take out the key/remote as well with you, but before coming out of the vehicle, do take a sneaky look at the surroundings for any suspicious person.