fix mail settings save function - ref #8854

Regression. It is not possible to call serialize() on a non form elment. Therefore the serialize of the mail settings just return an empty string and this got saved. This change fixes that.

partial fix of #8854 

Steps to test:
* go to mail settings in admin settings
* change them - wait for the green succes notification
* refresh page -> settings should be saved (not the case for master)

cc @nickvergessen @PVince81