Scalar field with Robin boundary conditions in the worldline formalism