Livingston held on for a 0-0 draw with Hamilton at Almondvale despite playing over an hour with 10 men.