In my experience, the gathering of referee reports is a burdensome task for an editor and the editorial office. One of the reasons that it can take so many months to get reports is that referees often do not answer promptly, or they say they will carry out the task, then change their minds, or they are just slow because of all the other demands on their time. Often, over a period of many months, we might find that we have tried 20 different referees in order to end up with the requisite four reports.
After all this work it is very annoying to then discover that the author wants to withdraw the paper! However, if the paper is rejected, then there is no real problem. Alternatively, if the decision is Major, or Reject & Resubmit, then that is an opportunity for the author to say to the editor that the requirements are just too harsh, and that he or she would prefer to withdraw it. But if an editor calls for minor revisions, or simply accepts the paper, the author really should not withdraw it. It would be bad protocol, because the editorial office and the referees wouyld have been working through this process for no reason. Perhaps the question to ask is, why would an author want to withdraw a paper mid-way through a long refereeing process? I have come across situations where an author has realized, too late, that there are such significant flaws in the paper that it really should go no further. This would need some careful dialogue wit the editor, explaining why the paper cannot continue in the process.
I summed up my advice thus. Therefore, you need pretty strong reasons for withdrawal. Either the editor's requirements are too harsh, or you have discovered some aspect of the paper that renders it unpublishable. I don't think that you should withdraw for any other reason, unless you want to upset the editor!