Pakistan court grants bail to ailing former premier