Non-geometric fluxes, Bianchi identities and Courant algebroids