Fix thread stack initialization on BSD platforms.

This is a fix for bug #9732 reported on the Xamarin Bugzilla. BSD uses `pthread_attr_get_np` instead of Linux's `pthread_getattr_np`. Without this, sgen compiles on FreeBSD 9.1 and sometimes runs but certain programs cause it to crash. Using the BSD-specific API call to initialize the thread's stack fixes this problem and allows sgen to work as it should.