Hi Stephan,
request.getSession() creates a new session if there isn't already one (what's true for the first request) and its ID is available immediately after that, so it will work for the first request as well.
If you are creating your sessions programmatically, you may know where request.getSession() is called and you could set the session cookie just immediately afterwards.
Another solution would be a servlet filter that wraps the response and overrides the setHeader(String name, String value) method and check for calls with "SET-COOKIE" for name and values beginning with "JSESSIONID" and if it's the case, just append "; HttpOnly" to the value before calling the setHeader method of the wrapped response.