Improve GPT Partition Detection in libefi

These commits have been in my local branch for a while. They are long overdue for going upstream.