BytecodeCompleter: fix handling of classes containing anonymous classes