The convicted sex offender Christian B has been released from prison after a prosecutor failed to find enough evidence to charge him in the Madeleine McCann case.