Allow ASTFile to be reset to null

Which we do in removeModules().
Fix test case.