In a surprise development, a Japanese court has granted bail for the former chairman of Nissan, Carlos Ghosn.