Resources: Fix loop termination for the get AML length function.

The loop terminates on a NULL resource pointer, which can never happen
since the loop simply increments a valid resource pointer. This fix
changes the loop to terminate on an end-of-buffer condition.

Problem can be seen by callers to AcpiSetCurrentResources with an invalid
or corrupted resource descriptor; or a resource descriptor without an
END_TAG descriptor.

Reported by Dan Carpenter <dan.carpenter@oracle.com>.  Fixed by
Lv Zheng, Bob Moore.