More hwloc thread pinning fixes

This fixes issues #473, #526 and #529