Bug 1109361 - Make ProfileInformationCache loading robust against empty files.

This adds a test that reproduces the problem, then fixes it by using `Scanner`'s `hasNext` method and the existing control flow.