String principal bundles and Courant algebroids