toolbox: Avoid issues with non-regular files

Toolbox uses open() in order to check for existence of a file, instead
of using stat(). This breaks when using non-regular files such as FIFO,
because opening a FIFO for reading blocks until a writer is available.

Change-Id: I008d246d68f7ce56040f4b4c36e5ff4f9c34f4dc
Merge remote-tracking branch 'cyanogen/cm-11.0' into cm-11.0