I'm guessing that the rainshower head is on the ceiling. The piping must have some horizontal component on the ceiling. Think of a straw when you put your finger over the end then pull it out of the glass of water - the water holds in the straw. Well, when you shut off the valve, the water is sort of like that. I don't think there's much you could do about it.