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 branch 'cm-11.0' of github.com:CyanogenMod/android_system_core into cm-11.0