Four Turkish academics have been released after being accused of spreading "terrorist propaganda" which angered the country's president Recep Tayyip Erdogan.