vfs: Add get_write_ioflag helper to calculate ioflag
Converted vn_write to use this helper.
Sponsored by: The FreeBSD Foundation
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31513
(cherry picked from commit c15384f8963191a238cb4a33382b4d394f1ac0b4)