Fix calling try_delete before importing it.

Previously, the import of try_delete was after one of the blocks
of code that called it, so it could result in an error at runtime.