Fixes #5061: create generic method to check http status

```${paths.path[curl]}``` ;)

See https://github.com/cfengine/masterfiles/blob/master/lib/3.6/paths.cf#L360