WFLY-2681 Send correct content type from management REST API

Also fix some Undertow usage to be more correct/efficent