Australian journalist Cheng Lei has been allowed to leave the country and is back home in Australia after being detained for more than three years on charges of espionage.