libthr: add some tests for pthread_atfork() handling
Test that it generally functions, and also that registering multiple
times calls each handler in the order that it's documented to call them
in.
Reviewed by: kib, markj
(cherry picked from commit 7e6ac503ffeb81733272d54af367db58e45e57ca)