gpiolib: Split GPIO flags parsing and GPIO configuration