check_http: Fix for checking http on different virtual port

Just turning attached patch of github issue #1026 into a push request
(with small adjustments).