Under-pressure German Chancellor Friedrich Merz has described a state election result as a "disaster" but vowed to stay in office.