Thread safer sigwinch handling and don't call stuff from trap context

Don't fail if mutex is already locked by current thread, but rather
return. The signwinch variable will be updated anyway.

Do the sigwinch stuff in a new thread as in the workaround in
https://bugs.ruby-lang.org/issues/7917#note-3

Should hopefully fix both: #59 and #90.