Full Counting Statistics of Heat and Work in the Non-Markovian Regime