CppEditor: Handle namespaces when generating method definitions

Consequent use of insertLocationForMethodDefinition respects the
surrounding namespace when moving/inserting definitions.

Task-number: QTCREATORBUG-2676
Task-number: QTCREATORBUG-9332
Change-Id: I6d83cf84d844dd4773900d03563581c88befa7b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>