how to prevent hair loss caused by medication