both check_curl and check_http have implemented the same validation function. this change relocates the implementation to a shared location to be used by both.