don't detach encoder when paused

This prevents stream dropping when resuming from pause. It is an even
better solution for #292