catch exceptions in JS callback

Task-number: QTCREATORBUG-11866

Change-Id: Ieb952bf92cc7837e4a59d147b63b3533ba63e1cd
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>