Freezer: don't skip processes with file locks

To prevent deadlock, freezer had to skip all processes holding any file
locks. As SQLite is using exclusive locks, a lot of applications won't
be frozen. The new logic will detect the lock dependencies and only
unfreeze the processes that block others.

This patch also adds a rewind() function to ProcFileReader class so that
ProcLocksReader doesn't open/close procfs nodes and create new instance
each time /proc/locks is parsed.

Bug: 176927978
Test: atest ProcFileReaderTest
Test: atest ProcLocksReaderTest
Test: verified processes with file locks could be frozen
Test: verified processes with blocking file locks were unfrozen
Change-Id: Ic2c89e6dcc9ee186840731c911be2aa3247b1352
6 files changed