Support extend declarations that are nested.

No matter in what context they are specified (e.g., inside of a message), extend declarations are always treated as being part of the scope of the root of the proto file.