Refactor file open checks

* Return 0 on success, <0 on error.
* No need to seek check the normal files.
* Use perror(): when a system call fails, it is useful to know why.
* If the checks fail, don't try to access the device in the error path.

BUG=chromium-os:21568
TEST=builds clean
  file open/access checks pass in the normal case
  file open checks fail when:
    * no device present
    * firmware file doesn't exist
    * permissions are wrong for backup file

Change-Id: Ie7589c6bebed670974425c748f9107263dc01e5d
1 file changed