Actually, it's possible to die after finishing, and that enemies keep walking after you finish. The explanation is here. It may be hard to reproduce, and I'm not sure that it always will happen (probably depends on how many Hammer Bro you have collected). Mario-Fan has recorded a video (see the post below) - watch from 32:30. Also, Rey D posted screenshots here. I don't know if there's any other method of reproducing the glitch... Probably it happens because the hammer bros are too many, so the game ignores some of them when cleaning them up.