lottery

another attempt at merging the code :P
lottery

removed the arg from lottery's prototype (it wasn't needed)
added "if (rmp->flags & IN_USE)" in lottery() and ticket_count() just to
be safe but they should be fine without those changes because tickets is
set to zero for processes with IN_USE not set.