Fixing the locks so that creates/deletes don't happen out of order