[osx] - ensure that the onresetdevice callback is called whenever a
lostdevice callback was called before. Do this by adding a timer. Also
handle "flags == 0" as devicereset (on some strange constellations we are
called with flags 0 instead of proper flags - this is undocumented but
it happens...).