WICKET-5639 ResourceResponse does not write headers when status code is set

(cherry picked from commit c95d8f74c30a1838daa9c92208bcbe8904372957)