Banker algorithm implemented by C#