dbi_test: Make tests support CK_FORK=no.

… by resetting state as needed.