fix errno behavior in clock_* functions