what were the only two African nations that were able to keep their freedom from European imperialism