BENGHAZI, Libya — A car bomb exploded Wednesday outside a building that once housed the US consulate in the Libyan city of Benghazi in what an official said was a warning that diplomats are not safe.