Fix bug in code scanner (gives an error)
for some reason, the camera plugin stopped working (says it does not have access to the div of the video).
From debugging (it worked in debugging, just not in normal), we found that a call to
navigator.mediaDevices.getUserMedia failed, appentrly for some timming issue.
Add a method to try a few times before failing