Move to using atomic_t for hart counts.
Split lithe_hart_grant_call() into two pieces

The first piece does the reference counting of the harts, the second does the
actual grant.  This is in preparation for the next commit which makes a bigger
change requiring only the portion of lithe_hart_grant() now moved into the
__lithe_hart_grant() function. It does it's own reference counting on the
harts.
Add reference coutning for the root_sched

This addition was necessary to ensure that we didn't allow the root scheduler
to exit (and potentially free its memory) before we were sure we no longer had
a reference to it.  Since harts can continue to trickle in even after you have
called sched_exit() on your scheduler, we needed to add some synchronization
to make sure that the base scheduler no longer held a reference to the root
schedule once it's sched_exit() function had completed.

Before adding this reference count, there was a time of read to time of use
bug on the root_sched variable in base_hart_enter().  Basically, we could grab
a reference to root_sched, decide to pass a hart down to it, but not yet up
its hart count, while another vcore was calling sched_exit() and checking to
make sure that its hart count was 0 (which it still could be at this point).
If the vcore running sched_exit() saw a hart count of 0 before the
base_hart_enter() core upped its hart count, it would happily exit and free
the scheduler even though a reference to it still existed.  The
base_hart_enter() core would then try and grant the core to a (now
non-existent) scheduler and we would segfault.

Adding the logic contained in this commit, fixes this race.