Unification of stochastic and quantum thermodynamics in scalar field theory via a model with a Brownian thermostat | Synapse