BytecodeCompleter: fix handling of named classes declared within methods