fix session program save and restore

ensure all non tmux specific save and restore functionality is dependent
on a program. Prepare for program save and restore plugin functionality.