Fix duplicate entries in BootOrder

The first two patches fix the duplicate entries in BootOrder and the comparison of the newly generated boot options and the existed boot options. The third patch provides a workaround to avoid the endless reset while dealing with some strange UEFI implementations...