write_stackdriver plugin: Centralize HTTP calls, add API error handling.