Fix compile failure with no-threads