Anomaly cancellation in supergravity with Fayet-Iliopoulos couplings