Fixed AllocMem in MotionDetect samples.