modules/utils: http_query fixes

- Credits to Guillaume Bour.