server: fix exception on write headers in request proxy