Improve handling of Go runtime scheduler