backend/view: Fix deadlock

There were two locks involved here; one for the buffer, and one
for the view. Unfortunate code ordering meant that we'd have one
thread locked one first and then the other, and another thread locking
the needed both locks but locked them in the reverse order.

The view's parsethread doesn't need to hold both locks at the same
time, so moved the view locking operation to where it is actually
needed.

Also added TestStress which was the minimal repro that helped me
track this one down and to ensure that it's not re-introduced in
the future.
frontend/qml: re-enable batching now that the deadlock is fixed