Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible

If the patch set wasn't loaded from the database don't load its
associated messages. This can happen as a race condition where:

 reader (T1):
   scans patch sets

 writer (T2):
   inserts new patch set
   inserts new message

  reader (T1):
    scans messages

The reader doesn't know about the new patch set and cannot
validate if it is a draft or not. Since the reader is under
the assumption the patch set does not exist simply skipping
newer messages is sane.

Change-Id: Ifd2000364bcf6ce8f37935bd8c4cc1725fb52a64
1 file changed