backends/drm: guard against the main thread modifying m_commits
The code after sleeping relies on m_commits not being empty, but if the main thread modifies it, that might not be the case
(cherry picked from commit f578483d)
Co-authored-by: Xaver Hugl xaver.hugl@gmail.com