set gpios to input before freeing