Add sigatomic_begin/end around sws_scale.

* Testing whether or not this fixes some crashes