Fixed crash when proxy_reverse is used together with logger; fixed two race conditions that may occur under heavy load