Fix #447: doctests fail when getpackage() returns None

When loading tests from a compiled extension, the result of
`getpackage(filename)` can be None, causing an error in
`DocTestCase.id()` when it tries to use the result as a string.  To fix
this, let's return the name of the doctest itself just like an
alternate path in `DocTestCase.id()`.