Madonna loses custody war for son with ex-hubby Ritchie