The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 non-JSON HTTP response with \'%i %s\' from server (503 Service Unavailable)
See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"