Fix potential undefined struct read

All the assignments to cb are inside conditionals, so it's
vaguely possible it never gets initialized before we try
to read from it with (cb.fn == NULL).

Condition discovered with scan-build.

All tests pass.