sched: Implement smarter wake-affine logic

This reverts commit efc80801d939f866aeb6e9b19a878c87dd1bf587.