fixed: potential endless-loop bug (thanks to FrankJepsen)

http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/p1209406-vdr-plugin-restfulapi-verursacht-100-cpu-last/#post1209406