(Original issue was created by @tim.plunkett at #2004282: Implement __sleep()/__wakeup() for entity controllers, and then I came and hijacked it towards more generic problems :-/.
So here is a separate issue to keep track of the original need - even though I think we should fix it with a broader approach)
Follow-up from #1909418-93: Allow Entity Controllers to have their dependencies injected
But what I think we should do, not necessarly in this issue, is implement __sleep()/__wakeup() where we throw out stuff we don't want to serialize (controllers, module handler, container, kernel, ....) and on wakeup get it back from the global container