QmlDesigner: Improve NodeInstanceServer::hasInstance

Test if instance is valid.

Change-Id: I748f3f95a2ad0669899e8029fdde4de0658ad11b
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
QmlDesigner: Don't try to access invalid node instances

Task-number: QTCREATORBUG-12444
Change-Id: I021e9669137de51c8feb0d7227d6d4c65a4d710c
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
QmlDesigner: Add test if the instance exists

Change-Id: I03f7e32aa0eda1f493c24ba174c706f4b8b0442c
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>