Dynamical structure functions from quantum Monte Carlo calculations of a proper integral transform