Add support for waking up only a given amount of threads

This will enable Erlang to run with options 'threads' and 'smp' on OSv