Well, there are two reasons (which will most certainly calm that curiosity).
First of all, it's to make sure the candy is fastened properly (both inside and out) and secondly, it's to prevent little kids or overzealous adults from choking on the stick long after the sweet has been eaten.
Who would've known it wasn't for the whistle?