[qtdeclarative] Fix memory corruption bug

In QQmlData::destroyed(), release the compiledData after
destroying the context instead of before. The context
contains bindings which may contain references to the
compiledData. (At least with V4 bindings)

This might cause heap corruption in QV4Bindings::Binding::disconnect()
because it uses values from 'program' (one of the datas[] values
from a QQmlCompiledData) to possibly modify memory via sub->setActive().

The reads from a freed program are easily reproduced (just start
an app under lipstick and then close it; detected with valgrind).
I haven't witnessed any heap corruption from this but it may be
behind the occasional crashes of lipstick.