Egypt frees prominent investigative journalist Hossam Bahgat, whose arrest was condemned by human rights campaigners.