power: Stay awake while battery_tool is running.

Expand powerd's existing code that checks for
/var/lock/flashrom_powerd.lock to additionally check for
/var/lock/battery_tool_powerd.lock. If either file exists
and contains the PID of an active process, powerd will defer
suspending or shutting down the system until the file is
gone to avoid interrupting firmware updates.

BUG=chrome-os-partner:36310
TEST=none

Change-Id: I55a5e97b71b00de1aa78ecd1114d787d9bdfab9a
Reviewed-on: https://chromium-review.googlesource.com/261318
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Tested-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
2 files changed