Core/DBLayer: Fixed possible crashes with async queries retrieving result

Closes #12655
Added comments to 6961f957c9d03bff634f0b75466458564845722e to make sure noone decides that storing the result in a variable is unneccessary