workqueue: test for empty queue before taking lock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>