Refactoring of the receive code to be more performant.

We now use a condition variable and run the receive event
on the main thread. The pending boolean is set to TRUE when
a packet is pending the completion of the receive event. This
effectively allows for the receive thread to continue and wait
for another packet.

We post a task to the TinyOS scheduler which will cause it to run
on the main thread. This task acts to signal the receive event. It
will also signal our pending condition variable which will wake the
receive thread up again if a packet has arrived in the meanwhile.

The biggest limitation of this approach is it will cause rather
unintuitive (out of order) packet loss. In pratice I don't
think this will be an issue, but be weary.