Improve QlApplication locking