Correctly release all wakelocks also when things go wrong

Signed-off-by: Simon Busch <morphis@gravedo.de>