Use put_iret_frame() to construct frames for iret

This eliminates some code duplication between sys_create() and
send_signal(), and has the added benefit of reducing architecture
dependence in these functions... sort of.
Minor refactoring in dispatch/process.c

Put a few chunks of code in helper functions.
Use dequeue_iterate macro to clear message queues

dequeue_iterate(head, elt, type) macro is defined in queue.h to
destructively iterate over a queue.  This is used in process.c to wake
blocked processes when clearing message queues.