check invalid file offset when loading library

Bug: 18178121
Bug: 18078224

Change-Id: I5254433d54645db68e9b83d5095dc2bf9d8531bc
Merge "check invalid file offset when loading library"