Code improvements in BaseX HTTP

Feel free to cherry-pick ;)