How to avoid a hostile takeover of first authorship during medical leave?
I would send an email along the following lines to the supervisor and copied to the person doing the additional piece of work. While not complete protection, this approach provides evidence and also makes it clear that the supervisor should respond if he doesn't intend to wait.

The draft article attached to the email should have a version number and date.


  Dear ...
  
  As requested, I have attached the latest draft of our paper, TITLE.
  It is saved at LOCATION, together with the data and analysis code.
  Unfortunately, I was unable to submit the draft before taking leave as
  planned because the data concerning XYZ was not available.
  
  I understand that OTHER-RESEARCHER is intending to complete his/her part of the
  analysis while I am on leave. I will verify that analysis and
  integrate it with the existing paper as my first task on my return in
  a month. I understand that OTHER-RESEARCHER is willing to draft that section of
  the paper, but as lead author, I want to ensure that it is consistent
  with the existing message and style of the paper. I would therefore
  prefer that the analysis is prepared as a separate document and I will
  integrate it myself.
  
  Assuming that no additional questions are raised by this final
  analysis, I expect to be able to circulate the complete draft within a
  week of my return for submission shortly thereafter. As the analysis
  has already taken NN months, I don't expect this delay to create any
  difficulties, but please let me know if you are concerned about
  waiting until my return for the paper to be completed.


Depending on the reason for the medical leave, it may also be appropriate to add a final paragraph:


  If there are any questions about this work, I am contactable during my
  leave at EMAIL