Fixed #677: Request is not properly unlocked if an exception occurs