T-branes, monopoles and S-duality