German activist and journalist freed after five months