The Indian prime minister’s demonetisation of 500 and 1,000 rupee notes has come in for heavy criticism – but if he succeeds, a lasting legacy beckons