Fix some bugs related to QJSValue

Give PersistentValuePrivate a virtual destructor. This makes
sure we properly delete things as QJSValuePrivate inherits from
it.

Also always access the QV4::Value through getValue() before passing
it off into the JS engine, so that we properly convert a QString
based JSValue into a QV4::String.

Change-Id: I4c6cb8d0e043e0d7f66fa545abe898e189051049
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reset the persistent values to undefined on destruction

This is what we expect the JSValue to return after
engine destruction.

Change-Id: I448b7987fa46f0e31711fa0c30561712bab5eca5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>