Remove race condition on shutdown.

The order of operations when shutting down a work unit is wrong (it
removes the ZNode before it allows the listener to shut down work). This
just swaps the order so that another node in the cluster won't attempt
to claim the work until it has been shut down.