UR2M: Uncertainty and Resource-Aware Event Detection on Microcontrollers