add enif_schedule_nif() to NIF API

Anthony Ramine came up with the idea of allowing a NIF to use an emulator
trap to schedule another NIF for later execution as a way of preventing
long-running NIF tasks from interfering with the VM's schedulers. This is
exactly how dirty NIFs are scheduled, so this commit refactors that support
to add the enif_schedule_nif() API function.

The enif_schedule_nif() function allows a long-running NIF to be broken
into separate NIF invocations that the emulator calls serially. The NIF
first executes part of the long-running task, then passes a NIF to
enif_schedule_nif() to schedule it for later execution so it can continue
the task.

Add documentation and a test for enif_schedule_nif().