Write a clean parser to handle a custom configuration or data format, ensuring graceful error handling for malformed inputs. Implement parse_config(text), where each nonempty, non-comment line has the form key=value; keys are identifiers, and values are integers or double-quoted strings. Return a dictionary of parsed values, or None for malformed input, including duplicate keys.
def parse_config(text):