some fixes for better gtk threading support