tests: Fix memory leak in thread test

The error path of a utility function in the NDK program thread test
could potentially leak an int if a thread-specific key had previously
been assigned.

Test: berberis_all
Change-Id: I05dfa582f127ef3362f48f3708625ea678ed714d
1 file changed