Tos. 61b "dilma" is mashma that not only are tefillin shel yad permitted in a bathroom, but that a person can use the bathroom while he is wearing tefillin. The Kadosh meKorville says that one does not have to remove his tefillin shel yad when he needs to use the bathroom. Also the Tos. in Menachos that the Gilion HaShas mentions also brings in the name of Reb Yakov meOrleans that he was mesupek if one must remove the tefillin shel yad before using the bathroom. How does this fit in with the sugia that we had earlier in Shabbos that tefillin b'eenan guf naki?
Best regards and thanks for the help,
(a) TOSFOS (61a, DH Dilma) writes in the name of the Kadosh m'Korville that it is not necessary to remove the Tefilin Shel Yad "when one needs" ("k'sh'Tzarich") to use the bathroom. In Menachos, Tosfos writes "when one enters" ("k'sh'Nichnas") the bathroom. According to this, Tosfos' intention is not to say that one actually used the bathroom while wearing Tefilin, for we know that it is certainly forbidden to defecate while wearing Tefilin, as the Gemara to which you refer states (49a). Rather, Tosfos is saying that one may enter the bathroom and then remove his Tefilin, prior to using the bathroom (and since one thus removes his Tefilin in a Reshus ha'Yachid, there is no concern that he might carry them in Reshus ha'Rabim). So, too, explains the TOSFOS HA'ROSH (62a, DH Shin).
(b) It should be noted that to urinate in a "temporary" bathroom (that is, one which is not used for defecating) while wearing Tefilin is permissible according to Tosfos in Berachos (23a). (That is, urinating is not called having a "Guf sh'Eino Naki.")