cleanCloseHandler: perform sanity check in goroutine
This PR changes cleanCloseHandler
to perform its sanity check in a goroutine: without this, the socket for the API request is kept open for the duration of the API call or the sanity check duration.