Synchrotron radiation from ultrahigh-intensity laser-plasma interactions and competition with Bremsstrahlung in thin foil targets