[release] Fix pthread*test.

Add missing underscore in PTHREAD_CFLAGS.
Add missing returns in solver functions.
Remove unsed typedefs and variables.