With scanners and electronic cash registers that compute the price, tax and change to be returned to the customer it's unlikely that a store clerk will pocket any part of the sale cost. The alternative is outright theft of the article, bypassing the cash register altogether.
No matter how the sale is made a dishonest clerk will be caught eventually. I think that, as you point out, harish, the pricing scheme of marking the dollars plus .95 cents was designed to make the buyer think that the actual price is less even though everyone knows that $39.95 is only a nickle less than $40.00.
Gasoline in the U.S., for example, is sold in tenths of a cent ($1.65 and 9/10). It is always, on every pump, the dollar and cent price plus 9/10 cent). So, the price is more accurately $1.66.
The origin of pricing this way may be that merchants wanted to demonstrate to the customer that their very lowest price that they could charge was a few cents less than what the product was worth, thus, in the days when every penny mattered, a few cents saved was a bargain. Today, it's just standard pricing.
_________________________
Some days it just doesn't seem worth trying to chew through the restraints.