Algeria says a German citizen has been released after a "criminal armed group" kidnapped him in Niger for two weeks ago.