pinctrl: pinconf: Add generic helper function for freeing mappings