sound: Handle midistat_lock through function interface
midistat_lock is used outside midi/midi.c as well, so implement lock,
unlock and lockassert functions in order not to expose the lock in the
header file.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D45857