fix(engine/variables): change variable to byte array inside same command

Fixes referential integrity constraint violation due to wrong ordering
of inserts in dbsqlsession.

related to #CAM-2052