Ion demagnetization in the magnetopause current layer observed by MMS