WORCESTER — Boston City Councilor Josh Zakim, making his first run at higher office, earned the upset endorsement of the Massachusetts Democratic Party convention Saturday, dealing a significant blow to Secretary of State William Galvin and showing that his campaign could be a legitimate threat to the state's longest-serving constitutional officer.