A simple javascript Mutex to queue tasks that can not run in parallel