Properly stop daemon