Replace index() with strchr()

Bionic (Android) has dropped support for index(), as has POSIX.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
examples: Don't pass uninitialized variables into the library

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
library: Fix handling of empty PIN strings

Commit bcb9124d4 (library: Allow overriding cached PIN) modified the
library behavior such that for any token that required a PIN, a PIN
passed into stoken_compute_tokencode() would override any PIN that was
read from .stokenrc or cached in the library context.  However, some
callers may have passed in an empty string if the PIN was cached.
Currently this may return -EINVAL; change it so it is handled the same
as passing in NULL.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>